Create a script for prompting the device path
This commit is contained in:
parent
2d72556079
commit
42e9cd15d3
1 changed files with 30 additions and 23 deletions
|
@ -44,6 +44,12 @@
|
|||
else "/dev/${config.deviceName}";
|
||||
};
|
||||
|
||||
deviceScript = mkOption {
|
||||
type = types.str;
|
||||
description = "A command for loading the device path into the device variable";
|
||||
internal = true;
|
||||
};
|
||||
|
||||
partitions = mkOption {
|
||||
type = types.attrsOf (types.nullOr partitionType);
|
||||
description = "The partitions of the disk.";
|
||||
|
@ -155,10 +161,7 @@
|
|||
''sudo sfdisk --part-type ${diskVar} ${toString partition.index} ${mkType partition.type}'')
|
||||
partitions);
|
||||
in {
|
||||
script = ''
|
||||
function partition() {
|
||||
${
|
||||
if osDisk && config.devicePath == null then ''
|
||||
deviceScript = if osDisk && config.devicePath == null then ''
|
||||
${diskSelector}
|
||||
''
|
||||
else ''
|
||||
|
@ -179,7 +182,11 @@
|
|||
fallback;
|
||||
fi
|
||||
'' else ""}
|
||||
''}
|
||||
'';
|
||||
|
||||
script = ''
|
||||
function partition() {
|
||||
${config.deviceScript}
|
||||
|
||||
${if (!config.wipe) then cleanup else ""}
|
||||
|
||||
|
|
Loading…
Reference in a new issue