Switch to just taking a->b instead of a list
This commit is contained in:
parent
c7919fe478
commit
1b580545e6
|
@ -74,10 +74,8 @@ in {
|
|||
};
|
||||
|
||||
extraCerts = mkOption {
|
||||
type = attrsOf (listOf str);
|
||||
description = ''
|
||||
Map of certificate name to a list of certificates to make available to the
|
||||
Authentik server (i.e. the public and optionally private keys).'';
|
||||
type = attrsOf str;
|
||||
description = "Map of certificate name to certificate location.";
|
||||
default = { };
|
||||
};
|
||||
|
||||
|
@ -111,14 +109,14 @@ in {
|
|||
wantedBy = [ "arion-authentik.service" ];
|
||||
before = [ "arion-authentik.service" ];
|
||||
script = let
|
||||
copyCommands = concatLists (mapAttrsToList (_: certs:
|
||||
concatMap (cert:
|
||||
let target = "${cfg.state-directory}/certs/${baseNameOf cert}";
|
||||
mkCopyCommand = name: src:
|
||||
let target = "${cfg.state-directory}/certs/${name}";
|
||||
in ''
|
||||
cp ${cert} ${target}
|
||||
chown authentik:root ${target}
|
||||
'') certs)) cfg.extraCerts;
|
||||
in concatStringsSep "\n" copyCommands;
|
||||
cp -v "${src}" "${target}"
|
||||
chown authentik:root "${target}"
|
||||
'';
|
||||
in concatStringsSep "\n"
|
||||
(mapAttrsToList mkCopyCommand cfg.extraCerts);
|
||||
};
|
||||
arion-authentik = {
|
||||
after = [ "network-online.target" "podman.service" ];
|
||||
|
|
Loading…
Reference in New Issue