diff options
| author | Alejandro Soto <alejandro@34project.org> | 2024-07-27 16:26:07 -0600 |
|---|---|---|
| committer | Alejandro Soto <alejandro@34project.org> | 2024-07-27 20:10:01 -0600 |
| commit | b63de52f9239a9b91db4ad222945c307158bbac2 (patch) | |
| tree | 1d36de0de3600e6dd0877eaf63ba518b48139833 /sys/pki/by-path.nix | |
| parent | 0fa5efb1ccc638652c829bebd75b774ccd6025b7 (diff) | |
sys/env, sys/pki: generate full list of certs by path
Diffstat (limited to '')
| -rw-r--r-- | sys/pki/by-path.nix | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/sys/pki/by-path.nix b/sys/pki/by-path.nix new file mode 100644 index 0000000..baca142 --- /dev/null +++ b/sys/pki/by-path.nix @@ -0,0 +1,15 @@ +{ config, lib, ... }: +with lib; { + options.local.pki.byPath = mkOption { + type = with lib.types; attrsOf unspecified; + readOnly = true; + }; + + config.local.pki.byPath = + let + caWithLeaves = ca: + singleton { "${ca.path}" = ca; } + ++ map (leaf: { "${leaf.path}" = leaf; }) (attrValues ca.leaves); + in + mergeAttrsList (flatten (map caWithLeaves (attrValues config.local.pki.ca))); +} |
