base/secrets: add tmpfiles rules for creating key storage file

This commit is contained in:
2025-10-18 15:27:41 -07:00
parent cd1c09f28e
commit 3a46f6b4de

View File

@@ -8,11 +8,19 @@
}:
with lib;
let
ageKeyDir = "/var/lib/sops";
ageKeyFile = "${sopsDir}/keys.txt";
in
{
imports = [ inputs.sops-nix.nixosModules.sops ];
systemd.tmpfiles.rules = [
"d ${ageKeyDir} 0700 root root -"
"C ${ageKeyFile} 0400 root root -"
];
sops.defaultSopsFile = ../secrets/${config.networking.hostName}.yml;
sops.defaultSopsFormat = "yaml";
sops.age.keyFile = "/var/lib/sops/age/keys.txt";
sops.age.keyFile = ageKeyFile;
}