nixos/filesystems/zfs: Use proper script mode

Tell zpool-list(8) to format output rather than modifying it afterwards.

Furthermore, pool names may contain spaces and would thus break due to
awk(1)'s word splitting.
This commit is contained in:
Klemens Nanni 2022-05-03 15:57:30 +02:00
parent 2a341bd2f4
commit d1754b1ab0

View file

@ -666,7 +666,7 @@ in
# expand every pool. Otherwise we want to enumerate
# just the specifically provided list of pools.
poolListProvider = if cfgExpandOnBoot == "all"
then "$(zpool list -H | awk '{print $1}')"
then "$(zpool list -H -o name)"
else lib.escapeShellArgs cfgExpandOnBoot;
in
{