]> git.immae.eu Git - perso/Immae/Config/Nix.git/blame - virtual/modules/certificates.nix
Start moving websites to their own modules: certificates
[perso/Immae/Config/Nix.git] / virtual / modules / certificates.nix
CommitLineData
3013caf1
IB
1{ lib, pkgs, config, mylibs, ... }:
2{
3 options.services.myCertificates = {
4 certConfig = lib.mkOption {
5 default = {
6 webroot = "/var/lib/acme/acme-challenge";
7 email = "ismael@bouya.org";
8 postRun = ''
9 systemctl reload httpd.service
10 '';
11 plugins = [ "cert.pem" "chain.pem" "fullchain.pem" "full.pem" "key.pem" "account_key.json" ];
12 };
13 description = "Default configuration for certificates";
14 };
15 };
16
17 config = {
18 # FIXME: doesn't work with httpd?
19 security.acme.preliminarySelfsigned = true;
20
21 security.acme.certs = {
22 # FIXME: /!\ To create a new certificate, create it before using
23 # it in httpd
24 "eldiron" = config.services.myCertificates.certConfig // {
25 domain = "eldiron.immae.eu";
26 allowKeysForGroup = true;
27 };
28 };
29 };
30}