diff options
| author | Alejandro Soto <alejandro@34project.org> | 2024-07-28 13:23:37 -0600 |
|---|---|---|
| committer | Alejandro Soto <alejandro@34project.org> | 2024-07-28 13:23:57 -0600 |
| commit | bd30588eac90b498457c7e0b5687a33e7585425a (patch) | |
| tree | 068404d578f686a2e9f8bef0cf1a41911808a5b4 /pki/by-path.nix | |
| parent | baf553ca73b842062aaf957a227fcb18ebfdf5ae (diff) | |
pki: rename from sys/pki, import in home
Diffstat (limited to 'pki/by-path.nix')
| -rw-r--r-- | pki/by-path.nix | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/pki/by-path.nix b/pki/by-path.nix new file mode 100644 index 0000000..baca142 --- /dev/null +++ b/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))); +} |
