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

@ -1,5 +1,6 @@
{
config,
lib,
...
}:
let
@ -7,10 +8,16 @@ let
proxyWebsockets = true;
proxyPass = "http://localhost:7575";
};
hasSecret =
secret:
let
secrets = config.age.secrets or { };
in
secrets ? ${secret} && secrets.${secret} != null;
in
{
# TODO transfer these to o001 to use same certs?
security.acme = {
security.acme = lib.mkIf (hasSecret "linode_rw_domains") {
acceptTerms = true;
defaults.email = "admin@joshuabell.xyz";
certs."joshuabell.xyz" = {