domain = "eldiron.immae.eu";
};
};
+
+ systemd.services = lib.attrsets.mapAttrs' (k: v:
+ lib.attrsets.nameValuePair "acme-selfsigned-${k}" (lib.mkBefore { script =
+ (lib.optionalString (builtins.elem "cert.pem" v.plugins) ''
+ cp $workdir/server.crt /var/lib/acme/${k}/cert.pem
+ chown '${v.user}:${v.group}' /var/lib/acme/${k}/cert.pem
+ chmod ${if v.allowKeysForGroup then "750" else "700"} /var/lib/acme/${k}/cert.pem
+ '') +
+ (lib.optionalString (builtins.elem "chain.pem" v.plugins) ''
+ cp $workdir/ca.crt /var/lib/acme/${k}/chain.pem
+ chown '${v.user}:${v.group}' /var/lib/acme/${k}/chain.pem
+ chmod ${if v.allowKeysForGroup then "750" else "700"} /var/lib/acme/${k}/chain.pem
+ '')
+ ; })
+ ) config.security.acme.certs // {
+ httpdProd.after = [ "acme-selfsigned-certificates.target" ];
+ httpdProd.wants = [ "acme-selfsigned-certificates.target" ];
+ httpdTools.after = [ "acme-selfsigned-certificates.target" ];
+ httpdTools.wants = [ "acme-selfsigned-certificates.target" ];
+ httpdInte.after = [ "acme-selfsigned-certificates.target" ];
+ httpdInte.wants = [ "acme-selfsigned-certificates.target" ];
+ };
};
}