caddy: init
This commit is contained in:
parent
2dd3ade483
commit
25f02ec9ee
6 changed files with 118 additions and 25 deletions
34
modules/services/caddy.nix
Normal file
34
modules/services/caddy.nix
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
{ pkgs, config, lib, ... }:
|
||||
|
||||
{
|
||||
options = {
|
||||
homelab.domain = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
};
|
||||
};
|
||||
|
||||
config = {
|
||||
homelab.domain = "nyanyanya.myaddr.io";
|
||||
networking.firewall.allowedTCPPorts = [ 80 443 ];
|
||||
|
||||
services.caddy = {
|
||||
enable = true;
|
||||
};
|
||||
|
||||
security.acme = {
|
||||
acceptTerms = true;
|
||||
defaults.email = "nicocute@proton.me";
|
||||
|
||||
certs."${config.homelab.domain}" = {
|
||||
group = config.services.caddy.group;
|
||||
|
||||
domain = "${config.homelab.domain}";
|
||||
extraDomainNames = [ "*.${config.homelab.domain}" ];
|
||||
dnsProvider = "myaddr";
|
||||
dnsResolver = "1.1.1.1:53";
|
||||
dnsPropagationCheck = true;
|
||||
environmentFile = /var/lib/caddy/secret;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue