turn all extraArgs into lists
This commit is contained in:
@@ -27,7 +27,7 @@
|
||||
end = "100%";
|
||||
content = {
|
||||
type = "btrfs";
|
||||
extraArgs = "-f"; # Override existing partition
|
||||
extraArgs = [ "-f" ]; # Override existing partition
|
||||
subvolumes = {
|
||||
# Subvolume name is different from mountpoint
|
||||
"/rootfs" = {
|
||||
|
||||
+4
-4
@@ -7,9 +7,9 @@
|
||||
description = "Type";
|
||||
};
|
||||
extraArgs = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
default = "";
|
||||
description = "Arguments to pass to BTRFS";
|
||||
type = lib.types.listOf lib.types.str;
|
||||
default = [ ];
|
||||
description = "Extra arguments";
|
||||
};
|
||||
mountOptions = lib.mkOption {
|
||||
type = lib.types.listOf lib.types.str;
|
||||
@@ -37,7 +37,7 @@
|
||||
_create = diskoLib.mkCreateOption {
|
||||
inherit config options;
|
||||
default = { dev }: ''
|
||||
mkfs.btrfs ${dev} ${config.extraArgs}
|
||||
mkfs.btrfs ${dev} ${toString config.extraArgs}
|
||||
${lib.concatMapStrings (subvol: subvol._create { inherit dev; }) (lib.attrValues config.subvolumes)}
|
||||
'';
|
||||
};
|
||||
|
||||
@@ -13,9 +13,9 @@
|
||||
description = "Type";
|
||||
};
|
||||
extraArgs = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
default = "";
|
||||
description = "Extra arguments to pass";
|
||||
type = lib.types.listOf lib.types.str;
|
||||
default = [ ];
|
||||
description = "Extra arguments";
|
||||
};
|
||||
mountOptions = lib.mkOption {
|
||||
type = lib.types.listOf lib.types.str;
|
||||
@@ -41,7 +41,7 @@
|
||||
(
|
||||
mount ${dev} "$MNTPOINT" -o subvol=/
|
||||
trap 'umount $MNTPOINT; rm -rf $MNTPOINT' EXIT
|
||||
btrfs subvolume create "$MNTPOINT"/${config.name} ${config.extraArgs}
|
||||
btrfs subvolume create "$MNTPOINT"/${config.name} ${toString config.extraArgs}
|
||||
)
|
||||
'';
|
||||
};
|
||||
|
||||
@@ -7,9 +7,9 @@
|
||||
description = "Type";
|
||||
};
|
||||
extraArgs = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
default = "";
|
||||
description = "Arguments to pass";
|
||||
type = lib.types.listOf lib.types.str;
|
||||
default = [ ];
|
||||
description = "Extra arguments";
|
||||
};
|
||||
mountOptions = lib.mkOption {
|
||||
type = lib.types.listOf lib.types.str;
|
||||
@@ -35,7 +35,7 @@
|
||||
inherit config options;
|
||||
default = { dev }: ''
|
||||
mkfs.${config.format} \
|
||||
${config.extraArgs} \
|
||||
${toString config.extraArgs} \
|
||||
${dev}
|
||||
'';
|
||||
};
|
||||
|
||||
+3
-3
@@ -22,8 +22,8 @@
|
||||
description = "LVM type";
|
||||
};
|
||||
extraArgs = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
default = "";
|
||||
type = lib.types.listOf lib.types.str;
|
||||
default = [ ];
|
||||
description = "Extra arguments";
|
||||
};
|
||||
content = diskoLib.partitionType;
|
||||
@@ -43,7 +43,7 @@
|
||||
${if lib.hasInfix "%" config.size then "-l" else "-L"} ${config.size} \
|
||||
-n ${config.name} \
|
||||
${lib.optionalString (config.lvm_type != null) "--type=${config.lvm_type}"} \
|
||||
${config.extraArgs} \
|
||||
${toString config.extraArgs} \
|
||||
${vg}
|
||||
${lib.optionalString (config.content != null) (config.content._create {dev = "/dev/${vg}/${config.name}";})}
|
||||
'';
|
||||
|
||||
Reference in New Issue
Block a user