@@ -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