From bd30588eac90b498457c7e0b5687a33e7585425a Mon Sep 17 00:00:00 2001 From: Alejandro Soto Date: Sun, 28 Jul 2024 13:23:37 -0600 Subject: pki: rename from sys/pki, import in home --- pki/by-path.nix | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 pki/by-path.nix (limited to 'pki/by-path.nix') 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))); +} -- cgit v1.2.3