feat(dashy): broken
This commit is contained in:
@@ -2,43 +2,37 @@
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
let
|
||||
}: let
|
||||
inherit (lib) mkIf mkEnableOption;
|
||||
cfg = config.server.caddy;
|
||||
|
||||
getCloudflareCredentials =
|
||||
hostname:
|
||||
if hostname == "ziggy" then
|
||||
config.age.secrets.cloudflareDnsCredentialsZiggy.path
|
||||
else if hostname == "sobotka" then
|
||||
config.age.secrets.cloudflareDnsCredentials.path
|
||||
else
|
||||
throw "Unknown hostname: ${hostname}";
|
||||
in
|
||||
{
|
||||
getCloudflareCredentials = hostname:
|
||||
if hostname == "ziggy"
|
||||
then config.age.secrets.cloudflareDnsCredentialsZiggy.path
|
||||
else if hostname == "sobotka"
|
||||
then config.age.secrets.cloudflareDnsCredentials.path
|
||||
else throw "Unknown hostname: ${hostname}";
|
||||
in {
|
||||
options = {
|
||||
server.caddy.enable = mkEnableOption "Enables caddy";
|
||||
};
|
||||
config = mkIf cfg.enable {
|
||||
networking.firewall =
|
||||
let
|
||||
ports = [
|
||||
80
|
||||
443
|
||||
];
|
||||
in
|
||||
{
|
||||
allowedTCPPorts = ports;
|
||||
};
|
||||
networking.firewall = let
|
||||
ports = [
|
||||
80
|
||||
443
|
||||
];
|
||||
in {
|
||||
allowedTCPPorts = ports;
|
||||
};
|
||||
|
||||
security.acme = {
|
||||
acceptTerms = true;
|
||||
defaults.email = config.server.email;
|
||||
certs.${config.server.domain} = {
|
||||
reloadServices = [ "caddy.service" ];
|
||||
reloadServices = ["caddy.service"];
|
||||
domain = "${config.server.domain}";
|
||||
extraDomainNames = [ "*.${config.server.domain}" ];
|
||||
extraDomainNames = ["*.${config.server.domain}"];
|
||||
dnsProvider = "cloudflare";
|
||||
dnsResolver = "1.1.1.1:53";
|
||||
dnsPropagationCheck = true;
|
||||
|
||||
Reference in New Issue
Block a user