nixos/applications/acme.nix

44 lines
934 B
Nix
Raw Permalink Normal View History

2023-08-06 19:29:24 +00:00
{ config, pkgs, lib, ... }:
2023-08-06 18:56:22 +00:00
with lib;
let
2023-08-06 19:29:24 +00:00
cfg = config.skynet_acme;
2023-08-06 18:56:22 +00:00
in {
imports = [];
2023-04-20 18:03:11 +00:00
2023-08-06 19:29:24 +00:00
options.skynet_acme = {
2023-08-06 18:56:22 +00:00
domains = lib.mkOption {
default = [ ];
type = lib.types.listOf lib.types.str;
description = ''
A list of domains to use for this server.
'';
2023-04-20 18:03:11 +00:00
};
2023-08-06 18:56:22 +00:00
};
config = {
# group that will own the certificates
users.groups.acme = {};
age.secrets.acme.file = ../secrets/dns_certs.secret.age;
security.acme = {
preliminarySelfsigned = false;
acceptTerms = true;
defaults = {
email = "admin_acme@skynet.ie";
# we use our own dns authorative server for verifying we own the domain.
dnsProvider = "rfc2136";
credentialsFile = config.age.secrets.acme.path;
};
2023-04-20 18:03:11 +00:00
2023-08-06 18:56:22 +00:00
certs = {
"skynet" = {
domain = "skynet.ie";
extraDomainNames = cfg.domains;
};
2023-04-20 18:03:11 +00:00
};
};
};
}