chore: refactored sops secrets

This commit is contained in:
Nick 2025-11-28 20:35:50 -06:00
parent 60c469ee7f
commit 9df4b8c8a0
13 changed files with 47 additions and 42 deletions

View file

@ -28,7 +28,7 @@ in
listenWeb = caddy.ports.port1;
listenHttp = service.ports.port0;
localDomain = host;
serviceEnvironmentFile = config.sops.secrets."${service.name}-root".path;
serviceEnvironmentFile = config.sops.secrets."${service.name}/root".path;
user = service.name;
plugins = {
enable = true;
@ -43,7 +43,7 @@ in
};
secrets = {
secretsFile = config.sops.secrets."${service.name}-secret".path;
secretsFile = config.sops.secrets."${service.name}/secret".path;
};
settings = {
instance = {
@ -64,16 +64,16 @@ in
};
database = {
createLocally = true;
passwordFile = config.sops.secrets."${service.name}-database".path;
passwordFile = config.sops.secrets."${service.name}/database".path;
};
redis = {
enableUnixSocket = true;
createLocally = true;
passwordFile = config.sops.secrets."${service.name}-redis".path;
passwordFile = config.sops.secrets."${service.name}/redis".path;
};
smtp = {
createLocally = true;
passwordFile = config.sops.secrets."${service.name}-smtp".path;
passwordFile = config.sops.secrets."${service.name}/smtp".path;
};
};
@ -94,7 +94,7 @@ in
sops =
let
sopsPath = secret: {
path = "${service.sops.path0}/${service.name}-${secret}-pass";
path = "${service.sops.path0}/${service.name}/${secret}";
owner = service.name;
mode = "600";
};
@ -103,7 +103,7 @@ in
secrets = builtins.listToAttrs (
map
(secret: {
name = "${service.name}-${secret}";
name = "${service.name}/${secret}";
value = sopsPath secret;
})
[