summaryrefslogtreecommitdiffstats
path: root/systems/ne/acme.nix
diff options
context:
space:
mode:
Diffstat (limited to 'systems/ne/acme.nix')
-rw-r--r--systems/ne/acme.nix39
1 files changed, 39 insertions, 0 deletions
diff --git a/systems/ne/acme.nix b/systems/ne/acme.nix
new file mode 100644
index 00000000..c54d487d
--- /dev/null
+++ b/systems/ne/acme.nix
@@ -0,0 +1,39 @@
+{ config, pkgs, ... }: {
+ security.acme.acceptTerms = true;
+
+ security.acme.certs."viljetic.de" = {
+ domain = "viljetic.de";
+ extraDomainNames = [
+ "*.viljetic.de"
+ ];
+ email = "tomislav@viljetic.de";
+ reloadServices = [
+ "knsupdate-viljetic.de.service"
+ "nginx.service"
+ ];
+ keyType = "ec384";
+ dnsProvider = "rfc2136";
+ environmentFile =
+ # format:
+ # RFC2136_NAMESERVER=ns1.viljetic.de
+ # RFC2136_TSIG_ALGORITHM=hmac-sha256.
+ # RFC2136_TSIG_KEY=acme
+ # RFC2136_TSIG_SECRET=<base64-encoded-secret>
+ "${config.krebs.secret.directory}/lego-knot-credentials";
+ };
+
+ # This is an alternative to
+ # security.acme.certs."viljetic.de".group = "nginx";
+ users.users.nginx.extraGroups = [ "acme" ];
+
+/*
+Aug 20 11:05:22 ni acme-viljetic.de-start[406499]: 2022/08/20 11:05:22 [INFO] acme: Registering account for tomislav@viljetic.de
+Aug 20 11:05:22 ni acme-viljetic.de-start[406499]: !!!! HEADS UP !!!!
+Aug 20 11:05:22 ni acme-viljetic.de-start[406499]: Your account credentials have been saved in your Let's Encrypt
+Aug 20 11:05:22 ni acme-viljetic.de-start[406499]: configuration directory at "accounts".
+Aug 20 11:05:22 ni acme-viljetic.de-start[406499]: You should make a secure backup of this folder now. This
+Aug 20 11:05:22 ni acme-viljetic.de-start[406499]: configuration directory will also contain certificates and
+Aug 20 11:05:22 ni acme-viljetic.de-start[406499]: private keys obtained from Let's Encrypt so making regular
+Aug 20 11:05:22 ni acme-viljetic.de-start[406499]: backups of this folder is ideal.
+*/
+}