git.iko.soy/typeable/nixpkgs
on master help sign in
Merge pull request #79248 from flokli/run-keys-group

nixos/filesystems: ensure keys gid on /run/keys mountpoint

commit64ece8cc9c83db29fb5037020faaa9ea4fdac088 authorFranz Pletz <fpletz@fnordicwalking.de> dateSat 8 Feb 2020, 14:52 (7 years ago) parentdd5f92f3c74e48
1 file changed+6−2
nixos/modules/tasks/filesystems.nix+6−2
nixos/modules/tasks/filesystems.nix+6−2
@@ -304,6 +304,10 @@ in
304304
305305 in listToAttrs (map formatDevice (filter (fs: fs.autoFormat) fileSystems));
306306
307+ systemd.tmpfiles.rules = [
308+ "Z /run/keys 0750 root ${toString config.ids.gids.keys}"
309+ ];
310+
307311 # Sync mount options with systemd's src/core/mount-setup.c: mount_table.
308312 boot.specialFileSystems = {
309313 "/proc" = { fsType = "proc"; options = [ "nosuid" "noexec" "nodev" ]; };
@@ -312,8 +316,8 @@ in
312316 "/dev/shm" = { fsType = "tmpfs"; options = [ "nosuid" "nodev" "strictatime" "mode=1777" "size=${config.boot.devShmSize}" ]; };
313317 "/dev/pts" = { fsType = "devpts"; options = [ "nosuid" "noexec" "mode=620" "ptmxmode=0666" "gid=${toString config.ids.gids.tty}" ]; };
314318
315− # To hold secrets that shouldn't be written to disk (generally used for NixOps, harmless elsewhere)
316− "/run/keys" = { fsType = "ramfs"; options = [ "nosuid" "nodev" "mode=750" "gid=${toString config.ids.gids.keys}" ]; };
319+ # To hold secrets that shouldn't be written to disk
320+ "/run/keys" = { fsType = "ramfs"; options = [ "nosuid" "nodev" "mode=750" ]; };
317321 } // optionalAttrs (!config.boot.isContainer) {
318322 # systemd-nspawn populates /sys by itself, and remounting it causes all
319323 # kinds of weird issues (most noticeably, waiting for host disk device