Skip to content

Commit

Permalink
-
Browse files Browse the repository at this point in the history
  • Loading branch information
oluceps committed Oct 16, 2024
1 parent b5a4cdd commit d1468c2
Showing 1 changed file with 17 additions and 20 deletions.
37 changes: 17 additions & 20 deletions repack/reuse-cert.nix
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
}:
reIf (
let
inherit (lib) optionalAttrs;
nameCondPair = [
{
name = "trojan-server";
Expand All @@ -20,7 +21,7 @@ reIf (
];
in
{
systemd.services =
systemd.services = lib.mkMerge [
(lib.foldr (
i: acc:
acc
Expand All @@ -43,27 +44,23 @@ reIf (
};
}
) { } nameCondPair)
// {
(optionalAttrs config.services.caddy.enable {
caddy.serviceConfig.EnvironmentFile = config.age.secrets.porkbun-api.path;
# hysteria-only.serviceConfig.LoadCredential = [
# "crt:${config.age.secrets."nyaw.cert".path}"
# "key:${config.age.secrets."nyaw.key".path}"
# ];
})
(optionalAttrs (builtins.any (i: i.serve) (lib.attrValues config.services.hysteria.instances)) {
hysteria-only.serviceConfig.LoadCredential =
lib.mkIf (builtins.any (i: i.serve) (lib.attrValues config.services.hysteria.instances))
map
(
map
(
s:
s
+ ":"
+ "/var/lib/caddy/certificates/acme-v02.api.letsencrypt.org-directory/nyaw.xyz/nyaw.xyz.${s}"
)
[
"key"
"crt"
]
);
};
s:
s
+ ":"
+ "/var/lib/caddy/certificates/acme-v02.api.letsencrypt.org-directory/nyaw.xyz/nyaw.xyz.${s}"
)
[
"key"
"crt"
];
})
];
}
)

0 comments on commit d1468c2

Please sign in to comment.