aboutsummaryrefslogtreecommitdiff
path: root/nixops/modules/certificates.nix
blob: 7fae7298c17e40389e42e3c19641ac6d7cd4fea5 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
{ lib, pkgs, config, mylibs, ... }:
{
  options.services.myCertificates = {
    certConfig = lib.mkOption {
      default = {
        webroot = "/var/lib/acme/acme-challenge";
        email = "ismael@bouya.org";
        postRun = ''
          systemctl reload httpdTools.service httpdInte.service httpdProd.service
        '';
        plugins = [ "cert.pem" "chain.pem" "fullchain.pem" "full.pem" "key.pem" "account_key.json" ];
      };
      description = "Default configuration for certificates";
    };
  };

  config = {
    security.acme.preliminarySelfsigned = true;

    security.acme.certs = {
      "eldiron" = config.services.myCertificates.certConfig // {
        domain = "eldiron.immae.eu";
      };
    };
  };
}