From 597ec76b7cb1527b1df215548a8f50bddccd8606 Mon Sep 17 00:00:00 2001 From: Alexander Foremny Date: Fri, 23 Feb 2024 08:07:11 +0100 Subject: apps/authelia: init --- modules/fysiweb-capabilities/default.nix | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) (limited to 'modules/fysiweb-capabilities/default.nix') diff --git a/modules/fysiweb-capabilities/default.nix b/modules/fysiweb-capabilities/default.nix index cbb57eb..bf1937b 100644 --- a/modules/fysiweb-capabilities/default.nix +++ b/modules/fysiweb-capabilities/default.nix @@ -3,6 +3,17 @@ let allApps = lib.concatMap lib.attrValues (lib.concatMap lib.attrValues (lib.attrValues config.fysiweb-apps)); in { + options.fysiweb.capabilities.password-credentials = lib.mkOption { + type = lib.types.attrsOf (lib.types.attrsOf (lib.types.submodule { + options.username = lib.mkOption { + type = lib.types.str; + }; + options.passwordFile = lib.mkOption { + type = lib.types.str; + }; + })); + default = { }; + }; options.fysiweb.capabilities.ssh-credentials = lib.mkOption { type = lib.types.attrsOf (lib.types.attrsOf (lib.types.submodule { options.publicKeyFile = lib.mkOption { @@ -12,12 +23,12 @@ in default = { }; }; config = { - fysiweb.capabilities.ssh-credentials = lib.listToAttrs (lib.concatMap + fysiweb.capabilities = lib.attrsets.mergeAttrsList (lib.concatMap (appConfig: let path = (toString ../../apps) + "/${appConfig.appName}/capabilities.nix"; in lib.optionals (lib.pathIsRegularFile path) [ - (lib.nameValuePair appConfig.appId - (import path { inherit appConfig lib; })) + (lib.mapAttrs (_: value: { ${appConfig.appId} = value; }) + (import path { inherit appConfig config lib; })) ]) allApps); }; -- cgit v1.2.3