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;
default =
let
formatOutput = (mode: members: ''
formatOutput = mode: members: ''
entries+=("${mode}=${
lib.concatMapStringsSep " "
(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);
mode = if !hasTopology then config.mode else "prescribed";
topology = if hasTopology then config.mode.topology else { };
mode = if hasTopology then "prescribed" else config.mode;
topology = lib.optionalAttrs hasTopology config.mode.topology;
in
''
readarray -t zfs_devices < <(cat "$disko_devices_dir"/zfs_${config.name})