Add akne module for getting self signed certs with acme client
This commit is contained in:
parent
6ee3387680
commit
51a3f6a1df
41
modules/akne/default.nix
Normal file
41
modules/akne/default.nix
Normal file
@ -0,0 +1,41 @@
|
|||||||
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
|
with lib;
|
||||||
|
|
||||||
|
let
|
||||||
|
cfg = config.clerie.akne;
|
||||||
|
|
||||||
|
in {
|
||||||
|
options = {
|
||||||
|
clerie.akne = {
|
||||||
|
enable = mkEnableOption "Makes fun stuff with the nixos acme module.";
|
||||||
|
selfSigneOnlyHostNames = mkOption {
|
||||||
|
type = with types; listOf str;
|
||||||
|
default = {};
|
||||||
|
description = "List of hostnames for which the acme client gets disabled. This hostnames use the self-signed certs instead.";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = {
|
||||||
|
systemd.services = with lib; listToAttrs (
|
||||||
|
flatten (
|
||||||
|
map (
|
||||||
|
name: [
|
||||||
|
(
|
||||||
|
nameValuePair "acme-${name}" {
|
||||||
|
enable = false;
|
||||||
|
wantedBy = mkForce [];
|
||||||
|
}
|
||||||
|
)
|
||||||
|
(
|
||||||
|
nameValuePair "acme-selfsigned-${name}" {
|
||||||
|
wantedBy = [ "multi-user.target" ];
|
||||||
|
}
|
||||||
|
)
|
||||||
|
]
|
||||||
|
) cfg.selfSigneOnlyHostNames
|
||||||
|
)
|
||||||
|
);
|
||||||
|
};
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user