tidy: apply suggestions from code review

Co-authored-by: Jörg Thalheim <Mic92@users.noreply.github.com>
This commit is contained in:
Dylan Madisetti 2024-08-26 14:13:07 -04:00 committed by GitHub
parent c9d3bc3755
commit 071306e76a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -135,16 +135,16 @@ in
inherit config options; inherit config options;
default = default =
let let
formatOutput = (mode: members: '' formatOutput = mode: members: ''
entries+=("${mode}=${ entries+=("${mode}=${
lib.concatMapStringsSep " " lib.concatMapStringsSep " "
(d: if lib.strings.hasPrefix "/" d then d else "/dev/disk/by-partlabel/disk-${d}-zfs") members (d: if lib.strings.hasPrefix "/" d then d else "/dev/disk/by-partlabel/disk-${d}-zfs") members
}") }")
''); '';
formatVdev = (vdev: formatOutput vdev.mode vdev.members); formatVdev = vdev: formatOutput vdev.mode vdev.members;
hasTopology = !(builtins.isString config.mode); hasTopology = !(builtins.isString config.mode);
mode = if !hasTopology then config.mode else "prescribed"; mode = if hasTopology then "prescribed" else config.mode;
topology = if hasTopology then config.mode.topology else { }; topology = lib.optionalAttrs hasTopology config.mode.topology;
in in
'' ''
readarray -t zfs_devices < <(cat "$disko_devices_dir"/zfs_${config.name}) readarray -t zfs_devices < <(cat "$disko_devices_dir"/zfs_${config.name})