mirror of
https://github.com/TECHNOFAB11/disko.git
synced 2025-12-12 08:00:05 +01:00
lib.types: turn _create, _mount and _config into values
This commit is contained in:
parent
8002e7cb89
commit
ab9b880db2
17 changed files with 194 additions and 146 deletions
|
|
@ -16,7 +16,7 @@
|
|||
type = diskoLib.optionTypes.absolute-pathname; # TODO check if subpath of /dev ? - No! eg: /.swapfile
|
||||
description = "Device path";
|
||||
};
|
||||
content = diskoLib.deviceType { parent = config; };
|
||||
content = diskoLib.deviceType { parent = config; device = config.device; };
|
||||
_meta = lib.mkOption {
|
||||
internal = true;
|
||||
readOnly = true;
|
||||
|
|
@ -27,18 +27,17 @@
|
|||
};
|
||||
_create = diskoLib.mkCreateOption {
|
||||
inherit config options;
|
||||
default = _: config.content._create { dev = config.device; };
|
||||
default = config.content._create;
|
||||
};
|
||||
_mount = diskoLib.mkMountOption {
|
||||
inherit config options;
|
||||
default = _:
|
||||
lib.optionalAttrs (config.content != null) (config.content._mount { dev = config.device; });
|
||||
default = lib.optionalAttrs (config.content != null) (config.content._mount);
|
||||
};
|
||||
_config = lib.mkOption {
|
||||
internal = true;
|
||||
readOnly = true;
|
||||
default =
|
||||
lib.optional (config.content != null) (config.content._config config.device);
|
||||
lib.optional (config.content != null) (config.content._config);
|
||||
description = "NixOS configuration";
|
||||
};
|
||||
_pkgs = lib.mkOption {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue