mirror of
https://github.com/nix-community/disko.git
synced 2024-09-17 09:37:17 +03:00
turn all extraArgs into lists
This commit is contained in:
parent
7585a30385
commit
6d630b8fe4
@ -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" = {
|
||||
|
@ -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}
|
||||
'';
|
||||
};
|
||||
|
@ -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}";})}
|
||||
'';
|
||||
|
Loading…
Reference in New Issue
Block a user