aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar Alexander Foremny <aforemny@posteo.de>2024-02-23 03:23:46 +0100
committerLibravatar Alexander Foremny <aforemny@posteo.de>2024-02-26 04:36:24 +0100
commit1057e0990509faa333843c7ab52536a95d50e7cc (patch)
treee7f130c425fe4f900b226f1096954fb9cccd4583
parent3b03ba1385278c512a5af00337e3ec707802c1ad (diff)
modules/fysiweb-capabilities: init
-rw-r--r--modules/fysiweb-capabilities/default.nix24
1 files changed, 24 insertions, 0 deletions
diff --git a/modules/fysiweb-capabilities/default.nix b/modules/fysiweb-capabilities/default.nix
new file mode 100644
index 0000000..cbb57eb
--- /dev/null
+++ b/modules/fysiweb-capabilities/default.nix
@@ -0,0 +1,24 @@
+{ config, lib, ... }:
+let
+ allApps = lib.concatMap lib.attrValues (lib.concatMap lib.attrValues (lib.attrValues config.fysiweb-apps));
+in
+{
+ options.fysiweb.capabilities.ssh-credentials = lib.mkOption {
+ type = lib.types.attrsOf (lib.types.attrsOf (lib.types.submodule {
+ options.publicKeyFile = lib.mkOption {
+ type = lib.types.str;
+ };
+ }));
+ default = { };
+ };
+ config = {
+ fysiweb.capabilities.ssh-credentials = lib.listToAttrs (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; }))
+ ])
+ allApps);
+ };
+}