aboutsummaryrefslogtreecommitdiffstats
path: root/modules/fysiweb-capabilities
diff options
context:
space:
mode:
Diffstat (limited to 'modules/fysiweb-capabilities')
-rw-r--r--modules/fysiweb-capabilities/default.nix17
1 files changed, 14 insertions, 3 deletions
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);
};