1
0
mirror of https://github.com/tboerger/nixos-config synced 2024-11-26 07:43:45 +01:00

module: add acme

This commit is contained in:
Thomas Boerger 2022-03-22 08:55:51 +01:00
parent d37daec9ed
commit b9a0c8e52d
No known key found for this signature in database
GPG Key ID: 09745AFF9D63C79B
5 changed files with 66 additions and 0 deletions

46
machines/modules/acme.nix Normal file

@ -0,0 +1,46 @@
{ pkgs, lib, config, options, ... }:
let
cfg = config.my.modules.acme;
in
{
options = with lib; {
my = {
modules = {
acme = {
enable = mkEnableOption ''
Whether to enable acme module
'';
};
};
};
};
config = with lib;
mkIf cfg.enable {
security = {
acme = {
acceptTerms = true;
defaults = {
email = "hostmaster@boerger.ws";
};
certs = {
"home.boerger.ws" = {
domain = "*.home.boerger.ws";
dnsProvider = "cloudflare";
credentialsFile = config.age.secrets.acme.path;
};
};
};
};
age.secrets.acme = {
file = ../../secrets/acme.age;
owner = "acme";
};
};
}

@ -4,6 +4,7 @@
imports = [
./settings.nix
./acme.nix
./boot.nix
./haveged.nix
./network.nix
@ -16,6 +17,10 @@
my = {
modules = {
acme = {
enable = lib.mkDefault false;
};
boot = {
enable = lib.mkDefault true;
};

@ -10,6 +10,14 @@
./networking.nix
];
my = {
modules = {
acme = {
enable = true;
};
};
};
system = {
stateVersion = "21.11";
};

BIN
secrets/acme.age Normal file

Binary file not shown.

7
secrets/secrets.nix Normal file

@ -0,0 +1,7 @@
let
thomas = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAINaQYR0/Oj6k1H03kshz2J7rlGCaDSuaGPhhOs9FcZfn";
users = [ thomas ];
in
{
"acme.age".publicKeys = users;
}