disko/default.nix
Jörg Thalheim 46177f0b30 disko: drop dependency on pkgs
This creates less headaches when importing nixos configuration and also
fix some flake use cases.
2022-09-13 13:29:18 +02:00

21 lines
528 B
Nix

{ lib ? import <nixpkgs/lib> }:
let
types = import ./types.nix { inherit lib; };
eval = cfg: lib.evalModules {
modules = lib.singleton {
# _file = toString input;
imports = lib.singleton { topLevel.devices = cfg; };
options = {
topLevel = lib.mkOption {
type = types.topLevel;
};
};
};
};
in {
types = types;
create = cfg: (eval cfg).config.topLevel.create;
mount = cfg: (eval cfg).config.topLevel.mount;
config = cfg: (eval cfg).config.topLevel.config;
}