diff --git a/nixos/modules/tasks/filesystems.nix b/nixos/modules/tasks/filesystems.nix index 84b66404f6f9..ce6fbefaea52 100644 --- a/nixos/modules/tasks/filesystems.nix +++ b/nixos/modules/tasks/filesystems.nix @@ -545,6 +545,29 @@ in # Sync mount options with systemd's src/core/mount-setup.c: mount_table. boot.specialFileSystems = { + # To hold secrets that shouldn't be written to disk + "/run/keys" = { + fsType = "ramfs"; + options = [ + "nosuid" + "nodev" + "mode=750" + ]; + }; + } + // optionalAttrs (!config.boot.isContainer) { + # systemd-nspawn populates /sys by itself, and remounting it causes all + # kinds of weird issues (most noticeably, waiting for host disk device + # nodes). + "/sys" = { + fsType = "sysfs"; + options = [ + "nosuid" + "noexec" + "nodev" + ]; + }; + "/proc" = { fsType = "proc"; options = [ @@ -592,29 +615,6 @@ in "gid=${toString config.ids.gids.tty}" ]; }; - - # To hold secrets that shouldn't be written to disk - "/run/keys" = { - fsType = "ramfs"; - options = [ - "nosuid" - "nodev" - "mode=750" - ]; - }; - } - // optionalAttrs (!config.boot.isContainer) { - # systemd-nspawn populates /sys by itself, and remounting it causes all - # kinds of weird issues (most noticeably, waiting for host disk device - # nodes). - "/sys" = { - fsType = "sysfs"; - options = [ - "nosuid" - "noexec" - "nodev" - ]; - }; }; };