summaryrefslogtreecommitdiffstats
path: root/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'default.nix')
-rw-r--r--default.nix21
1 files changed, 15 insertions, 6 deletions
diff --git a/default.nix b/default.nix
index 98f5213..8d91e7c 100644
--- a/default.nix
+++ b/default.nix
@@ -4,17 +4,26 @@ let
eval = cfg: lib.evalModules {
modules = lib.singleton {
# _file = toString input;
- imports = lib.singleton { topLevel.devices = cfg; };
+ imports = lib.singleton { devices = cfg; };
options = {
- topLevel = lib.mkOption {
- type = types.topLevel;
+ devices = lib.mkOption {
+ type = types.devices;
};
};
};
};
in {
types = types;
- create = cfg: (eval cfg).config.topLevel.create;
- mount = cfg: (eval cfg).config.topLevel.mount;
- config = cfg: (eval cfg).config.topLevel.config;
+ create = cfg: types.diskoLib.create (eval cfg).config.devices;
+ createScript = cfg: pkgs: pkgs.writeScript "disko-create" ''
+ export PATH=${lib.makeBinPath (types.diskoLib.packages (eval cfg).config.devices pkgs)}
+ ${types.diskoLib.create (eval cfg).config.devices}
+ '';
+ mount = cfg: types.diskoLib.mount (eval cfg).config.devices;
+ mountScript = cfg: pkgs: pkgs.writeScript "disko-mount" ''
+ export PATH=${lib.makeBinPath (types.diskoLib.packages (eval cfg).config.devices pkgs)}
+ ${types.diskoLib.mount (eval cfg).config.devices}
+ '';
+ config = cfg: { imports = types.diskoLib.config (eval cfg).config.devices; };
+ packages = cfg: types.diskoLib.packages (eval cfg).config.devices;
}