Loading nixos/modules/system/boot/systemd/tmpfiles.nix +4 −2 Original line number Diff line number Diff line Loading @@ -200,6 +200,10 @@ in rm -f $out/${removePrefix "tmpfiles.d/" name} '') config.system.build.etc.passthru.targets; }) + "/*"; "mtab" = { mode = "direct-symlink"; source = "/proc/mounts"; }; }; systemd.tmpfiles.packages = [ Loading Loading @@ -244,13 +248,11 @@ in "L+ /nix/var/nix/gcroots/booted-system 0755 root root - /run/booted-system" "d /run/lock 0755 root root - -" "d /var/db 0755 root root - -" "L /etc/mtab - - - - ../proc/mounts" "L /var/lock - - - - ../run/lock" # Boot-time cleanup "R! /etc/group.lock - - - - -" "R! /etc/passwd.lock - - - - -" "R! /etc/shadow.lock - - - - -" "R! /etc/mtab* - - - - -" "R! /nix/var/nix/gcroots/tmp - - - - -" "R! /nix/var/nix/temproots - - - - -" ]; Loading nixos/tests/activation/etc-overlay-immutable.nix +3 −0 Original line number Diff line number Diff line Loading @@ -32,6 +32,9 @@ with subtest("direct symlinks point to the target without indirection"): assert machine.succeed("readlink -n /etc/localtime") == "/etc/zoneinfo/Utc" with subtest("/etc/mtab points to the right file"): assert "/proc/mounts" == machine.succeed("readlink --no-newline /etc/mtab") with subtest("Correct mode on the source password files"): assert machine.succeed("stat -c '%a' /var/lib/nixos/etc/passwd") == "644\n" assert machine.succeed("stat -c '%a' /var/lib/nixos/etc/group") == "644\n" Loading nixos/tests/misc.nix +3 −0 Original line number Diff line number Diff line Loading @@ -99,6 +99,9 @@ in { with subtest("whether systemd-tmpfiles settings works"): machine.succeed("[ -e /tmp/somefile ]") with subtest("/etc/mtab"): assert "/proc/mounts" == machine.succeed("readlink --no-newline /etc/mtab") with subtest("whether automounting works"): machine.fail("grep '/tmp2 tmpfs' /proc/mounts") machine.succeed("touch /tmp2/x") Loading Loading
nixos/modules/system/boot/systemd/tmpfiles.nix +4 −2 Original line number Diff line number Diff line Loading @@ -200,6 +200,10 @@ in rm -f $out/${removePrefix "tmpfiles.d/" name} '') config.system.build.etc.passthru.targets; }) + "/*"; "mtab" = { mode = "direct-symlink"; source = "/proc/mounts"; }; }; systemd.tmpfiles.packages = [ Loading Loading @@ -244,13 +248,11 @@ in "L+ /nix/var/nix/gcroots/booted-system 0755 root root - /run/booted-system" "d /run/lock 0755 root root - -" "d /var/db 0755 root root - -" "L /etc/mtab - - - - ../proc/mounts" "L /var/lock - - - - ../run/lock" # Boot-time cleanup "R! /etc/group.lock - - - - -" "R! /etc/passwd.lock - - - - -" "R! /etc/shadow.lock - - - - -" "R! /etc/mtab* - - - - -" "R! /nix/var/nix/gcroots/tmp - - - - -" "R! /nix/var/nix/temproots - - - - -" ]; Loading
nixos/tests/activation/etc-overlay-immutable.nix +3 −0 Original line number Diff line number Diff line Loading @@ -32,6 +32,9 @@ with subtest("direct symlinks point to the target without indirection"): assert machine.succeed("readlink -n /etc/localtime") == "/etc/zoneinfo/Utc" with subtest("/etc/mtab points to the right file"): assert "/proc/mounts" == machine.succeed("readlink --no-newline /etc/mtab") with subtest("Correct mode on the source password files"): assert machine.succeed("stat -c '%a' /var/lib/nixos/etc/passwd") == "644\n" assert machine.succeed("stat -c '%a' /var/lib/nixos/etc/group") == "644\n" Loading
nixos/tests/misc.nix +3 −0 Original line number Diff line number Diff line Loading @@ -99,6 +99,9 @@ in { with subtest("whether systemd-tmpfiles settings works"): machine.succeed("[ -e /tmp/somefile ]") with subtest("/etc/mtab"): assert "/proc/mounts" == machine.succeed("readlink --no-newline /etc/mtab") with subtest("whether automounting works"): machine.fail("grep '/tmp2 tmpfs' /proc/mounts") machine.succeed("touch /tmp2/x") Loading