mirror of
https://github.com/nix-community/disko.git
synced 2026-11-30 13:03:28 +01:00
more quotes to make shellcheck happy
This commit is contained in:
1 parent
6d630b8fe4
commit
6da7333a76
6 files changed
+11
-7
No files matched your search
+1
-1
@@ -23,7 +23,7 @@
|
||||
inherit config options;
|
||||
default = { dev }: ''
|
||||
pvcreate ${dev}
|
||||
echo "${dev}" >> $disko_devices_dir/lvm_${config.vg}
|
||||
echo "${dev}" >> "$disko_devices_dir"/lvm_${config.vg}
|
||||
'';
|
||||
};
|
||||
_mount = diskoLib.mkMountOption {
|
||||
|
||||
+3
-1
@@ -27,7 +27,9 @@
|
||||
_create = diskoLib.mkCreateOption {
|
||||
inherit config options;
|
||||
default = _: ''
|
||||
vgcreate ${config.name} $(tr '\n' ' ' < $disko_devices_dir/lvm_${config.name})
|
||||
readarray -t lvm_devices < <(cat "$disko_devices_dir"/lvm_${config.name})
|
||||
vgcreate ${config.name} \
|
||||
"''${lvm_devices[@]}"
|
||||
${lib.concatMapStrings (lv: lv._create {vg = config.name; }) (lib.attrValues config.lvs)}
|
||||
'';
|
||||
};
|
||||
|
||||
+3
-2
@@ -34,13 +34,14 @@
|
||||
_create = diskoLib.mkCreateOption {
|
||||
inherit config options;
|
||||
default = _: ''
|
||||
readarray -t disk_devices < <(cat "$disko_devices_dir"/raid_${config.name})
|
||||
echo 'y' | mdadm --create /dev/md/${config.name} \
|
||||
--level=${toString config.level} \
|
||||
--raid-devices=$(wc -l $disko_devices_dir/raid_${config.name} | cut -f 1 -d " ") \
|
||||
--raid-devices="$(wc -l "$disko_devices_dir"/raid_${config.name} | cut -f 1 -d " ")" \
|
||||
--metadata=${config.metadata} \
|
||||
--force \
|
||||
--homehost=any \
|
||||
$(tr '\n' ' ' < $disko_devices_dir/raid_${config.name})
|
||||
"''${disk_devices[@]}"
|
||||
udevadm trigger --subsystem-match=block; udevadm settle
|
||||
${lib.optionalString (config.content != null) (config.content._create {dev = "/dev/md/${config.name}";})}
|
||||
'';
|
||||
|
||||
+1
-1
@@ -23,7 +23,7 @@
|
||||
_create = diskoLib.mkCreateOption {
|
||||
inherit config options;
|
||||
default = { dev }: ''
|
||||
echo "${dev}" >> $disko_devices_dir/raid_${config.name}
|
||||
echo "${dev}" >> "$disko_devices_dir"/raid_${config.name}
|
||||
'';
|
||||
};
|
||||
_mount = diskoLib.mkMountOption {
|
||||
|
||||
+1
-1
@@ -22,7 +22,7 @@
|
||||
_create = diskoLib.mkCreateOption {
|
||||
inherit config options;
|
||||
default = { dev }: ''
|
||||
echo "${dev}" >> $disko_devices_dir/zfs_${config.pool}
|
||||
echo "${dev}" >> "$disko_devices_dir"/zfs_${config.pool}
|
||||
'';
|
||||
};
|
||||
_mount = diskoLib.mkMountOption {
|
||||
|
||||
+2
-1
@@ -52,11 +52,12 @@
|
||||
_create = diskoLib.mkCreateOption {
|
||||
inherit config options;
|
||||
default = _: ''
|
||||
readarray -t zfs_devices < <(cat "$disko_devices_dir"/zfs_${config.name})
|
||||
zpool create ${config.name} \
|
||||
${config.mode} \
|
||||
${lib.concatStringsSep " " (lib.mapAttrsToList (n: v: "-o ${n}=${v}") config.options)} \
|
||||
${lib.concatStringsSep " " (lib.mapAttrsToList (n: v: "-O ${n}=${v}") config.rootFsOptions)} \
|
||||
$(tr '\n' ' ' < $disko_devices_dir/zfs_${config.name})
|
||||
"''${zfs_devices[@]}"
|
||||
${lib.concatMapStrings (dataset: dataset._create {zpool = config.name;}) (lib.attrValues config.datasets)}
|
||||
'';
|
||||
};
|
||||
|
||||
Reference in new issue
Block a user