git.iko.soy/typeable/nixpkgs
on master help sign in
nixos/confinement: add conflict for ProtectSystem service option

Systemd ProtectSystem is incompatible with the chroot we make for confinement. The options is redundant with what we do anyway so warn if it had been set and advise to disable it. Merges: https://github.com/NixOS/nixpkgs/pull/87420

commit4c81174f4cd0f9368c47d0878d8efa3ca3fb10a4 authorDominique Martinet <asmadeus@codewreck.org> dateSat 9 May 2020, 21:03 (7 years ago) parent5da1393
1 file changed+5
nixos/modules/security/systemd-confinement.nix+5
nixos/modules/security/systemd-confinement.nix+5
@@ -160,6 +160,11 @@ in {
160160 + " the 'users.users' option instead as this combination is"
161161 + " currently not supported.";
162162 }
163+ { assertion = !cfg.serviceConfig.ProtectSystem or false;
164+ message = "${whatOpt "ProtectSystem"}. ProtectSystem is not compatible"
165+ + " with service confinement as it fails to remount /usr within"
166+ + " our chroot. Please disable the option.";
167+ }
163168 ]) config.systemd.services);
164169
165170 config.systemd.packages = lib.concatLists (lib.mapAttrsToList (name: cfg: let