mirror of
https://github.com/TECHNOFAB11/disko.git
synced 2025-12-12 08:00:05 +01:00
revert mkCreateOption
This commit is contained in:
parent
a78d3ce578
commit
360ee1522f
1 changed files with 5 additions and 20 deletions
25
types.nix
25
types.nix
|
|
@ -141,24 +141,6 @@ rec {
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
mkCreateOption = { config, options, default }:
|
|
||||||
mkOption {
|
|
||||||
description = "Creation script";
|
|
||||||
internal = true;
|
|
||||||
readOnly = true;
|
|
||||||
type = types.str;
|
|
||||||
default = lib.concatStringsSep "\n" [
|
|
||||||
"(" #subshell for namespacing
|
|
||||||
(diskoLib.defineHookVariables { inherit config options; })
|
|
||||||
config.preCreateHook
|
|
||||||
default
|
|
||||||
config.postCreateHook
|
|
||||||
")"
|
|
||||||
];
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* Takes a disko device specification, returns an attrset with metadata
|
/* Takes a disko device specification, returns an attrset with metadata
|
||||||
|
|
||||||
meta :: types.devices -> AttrSet
|
meta :: types.devices -> AttrSet
|
||||||
|
|
@ -1189,8 +1171,10 @@ rec {
|
||||||
diskoLib.deepMergeMap (dataset: dataset._meta [ "zpool" config.name ]) (attrValues config.datasets);
|
diskoLib.deepMergeMap (dataset: dataset._meta [ "zpool" config.name ]) (attrValues config.datasets);
|
||||||
description = "Metadata";
|
description = "Metadata";
|
||||||
};
|
};
|
||||||
_create = diskoLib.mkCreateOption {
|
_create = mkOption {
|
||||||
inherit config options;
|
internal = true;
|
||||||
|
readOnly = true;
|
||||||
|
type = types.str;
|
||||||
default = ''
|
default = ''
|
||||||
zpool create ${config.name} \
|
zpool create ${config.name} \
|
||||||
${config.mode} \
|
${config.mode} \
|
||||||
|
|
@ -1199,6 +1183,7 @@ rec {
|
||||||
''${ZFSDEVICES_${config.name}}
|
''${ZFSDEVICES_${config.name}}
|
||||||
${concatMapStrings (dataset: dataset._create config.name) (attrValues config.datasets)}
|
${concatMapStrings (dataset: dataset._create config.name) (attrValues config.datasets)}
|
||||||
'';
|
'';
|
||||||
|
description = "Creation script";
|
||||||
};
|
};
|
||||||
_mount = mkOption {
|
_mount = mkOption {
|
||||||
internal = true;
|
internal = true;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue