1
0
mirror of https://github.com/tboerger/nixos-config synced 2024-11-22 18:21:58 +01:00
github.com-tboerger-nixos-c.../shared/services/acme.nix

61 lines
1.0 KiB
Nix
Raw Normal View History

{ pkgs, lib, config, options, ... }:
2022-09-27 22:07:46 +02:00
with lib;
let
cfg = config.personal.services.acme;
in
{
2022-09-27 22:07:46 +02:00
options = {
personal = {
services = {
acme = {
enable = mkEnableOption "Acme";
};
};
};
};
2022-09-27 22:07:46 +02:00
config = mkIf cfg.enable {
2024-07-17 16:05:33 +02:00
ids.uids = {
acme = 400;
};
ids.gids = {
acme = 400;
};
users.users.acme = {
uid = config.ids.uids.acme;
};
users.groups.acme = {
gid = config.ids.gids.acme;
};
2022-09-27 22:07:46 +02:00
security = {
acme = {
acceptTerms = true;
2022-09-27 22:41:24 +02:00
defaults = {
reloadServices = [ "nginx" ];
2022-09-27 22:41:24 +02:00
};
2022-09-27 22:07:46 +02:00
certs = {
"boerger.ws" = {
email = "hostmaster@boerger.ws";
extraDomainNames = [ "*.boerger.ws" ];
2022-09-27 22:07:46 +02:00
dnsProvider = "cloudflare";
credentialsFile = config.age.secrets."services/acme/credentials".path;
};
};
};
2022-09-27 22:07:46 +02:00
};
2022-09-27 22:07:46 +02:00
age.secrets."services/acme/credentials" = {
file = ../../secrets/services/acme/credentials.age;
2022-09-27 22:07:46 +02:00
owner = "acme";
};
2022-09-27 22:07:46 +02:00
};
}