diff options
Diffstat (limited to 'modules/fysiweb-secrets')
-rw-r--r-- | modules/fysiweb-secrets/default.nix | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/modules/fysiweb-secrets/default.nix b/modules/fysiweb-secrets/default.nix new file mode 100644 index 0000000..e494dde --- /dev/null +++ b/modules/fysiweb-secrets/default.nix @@ -0,0 +1,27 @@ +{ config, lib, ... }: +let + allApps = lib.concatMap lib.attrValues (lib.concatMap lib.attrValues (lib.attrValues config.fysiweb-apps)); +in +{ + options.fysiweb.secrets = lib.mkOption { + type = lib.types.listOf (lib.types.submodule { + options = { + type = lib.mkOption { + type = lib.types.enum [ "random-string" ]; + }; + path = lib.mkOption { + type = lib.types.str; + }; + }; + }); + default = [ ]; + }; + config = { + fysiweb.secrets = lib.concatMap + (appConfig: + let path = (toString ../../apps) + "/${appConfig.appName}/secrets.nix"; in + lib.optionals (lib.pathIsRegularFile path) + (import path { inherit appConfig lib; })) + allApps; + }; +} |