make all age use conditional

This commit is contained in:
RingOfStorms (Joshua Bell) 2025-10-27 23:03:40 -05:00
parent b2f0476412
commit 3cb6fba59e
8 changed files with 73 additions and 9 deletions

View file

@ -13,6 +13,13 @@ let
hostAddress6 = "fc00::1";
containerAddress6 = "fc00::3";
hasSecret =
secret:
let
secrets = config.age.secrets or { };
in
secrets ? ${secret} && secrets.${secret} != null;
binds = [
# Postgres data, must use postgres user in container and host
{
@ -31,6 +38,7 @@ let
uid = config.ids.uids.postgres;
gid = config.ids.gids.postgres;
}
] ++ lib.optionals (hasSecret "zitadel_master_key") [
# secret
{
host = config.age.secrets.zitadel_master_key.path;