Scaffolding
This commit is contained in:
parent
0447a25a77
commit
fce0a8e691
2 changed files with 15 additions and 1 deletions
|
|
@ -5,14 +5,28 @@
|
|||
enable = lib.mkEnableOption "Enables caddy webserver";
|
||||
vhosts = lib.mkOption {};
|
||||
adminEmail = lib.mkOption { type = lib.types.str; };
|
||||
environmentFile = lib.mkOption {};
|
||||
};
|
||||
|
||||
config = lib.mkIf config.caddy.enable {
|
||||
networking.firewall.allowedTCPPorts = [ 80 443 ];
|
||||
services.caddy = {
|
||||
enable = true;
|
||||
globalConfig = ''
|
||||
acme_dns porkbun {
|
||||
api_key {$APIKEY}
|
||||
api_secret_key {$APISECRETKEY}
|
||||
}
|
||||
'';
|
||||
package = pkgs.caddy.withPlugins {
|
||||
plugins = [ "github.com/caddy-dns/porkbun@0.3.1" ];
|
||||
hash = "";
|
||||
};
|
||||
virtualHosts = config.caddy.vhosts;
|
||||
email = config.caddy.adminEmail;
|
||||
};
|
||||
systemd.services.caddy.serviceConfig.EnvironmentFile = [
|
||||
config.caddy.environmentFile
|
||||
];
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@
|
|||
settings = {
|
||||
server_url = "https://${config.headscale.server.domain}";
|
||||
dns = {
|
||||
base_domain = "connect.claris";
|
||||
base_domain = "dns.${config.headscale.server.domain}";
|
||||
override_local_dns = false;
|
||||
};
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue