From 0fecd7edc884b5f397cb44fcaff88d52c34f3696 Mon Sep 17 00:00:00 2001 From: Nick Cao Date: Wed, 27 Sep 2023 14:33:21 -0400 Subject: [PATCH] nixos/stage-1-systemd: fix initrd-fstab generation for bind mounts, again See https://github.com/NixOS/nixpkgs/pull/185089 --- nixos/modules/tasks/filesystems.nix | 3 +-- 1 file changed, 1 insertion(+), 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