summaryrefslogtreecommitdiffstats
path: root/nixos/modules/tasks/filesystems.nix
diff options
context:
space:
mode:
authorNick Cao <nickcao@nichi.co>2023-09-27 14:33:21 -0400
committerNick Cao <nickcao@nichi.co>2023-09-27 14:34:17 -0400
commit0fecd7edc884b5f397cb44fcaff88d52c34f3696 (patch)
tree9a9e73d51bf771505c6c41d0e94382c0f011992d /nixos/modules/tasks/filesystems.nix
parent8a86b98f0ba1c405358f1b71ff8b5e1d317f5db2 (diff)
nixos/stage-1-systemd: fix initrd-fstab generation for bind mounts, again
See https://github.com/NixOS/nixpkgs/pull/185089
Diffstat (limited to 'nixos/modules/tasks/filesystems.nix')
-rw-r--r--nixos/modules/tasks/filesystems.nix3
1 files changed, 1 insertions, 2 deletions
diff --git a/nixos/modules/tasks/filesystems.nix b/nixos/modules/tasks/filesystems.nix
index 7cb2ca23fa41..3f553948d78d 100644
--- a/nixos/modules/tasks/filesystems.nix
+++ b/nixos/modules/tasks/filesystems.nix
@@ -188,8 +188,7 @@ let
# https://wiki.archlinux.org/index.php/fstab#Filepath_spaces
escape = string: builtins.replaceStrings [ " " "\t" ] [ "\\040" "\\011" ] string;
in fstabFileSystems: { rootPrefix ? "" }: concatMapStrings (fs:
- (optionalString (isBindMount fs) (escape rootPrefix))
- + (if fs.device != null then escape fs.device
+ (if fs.device != null then escape fs.device
else if fs.label != null then "/dev/disk/by-label/${escape fs.label}"
else throw "No device specified for mount point ‘${fs.mountPoint}’.")
+ " " + escape fs.mountPoint