diff --git a/deployment/data-model.nix b/deployment/data-model.nix index d28c39b1..74c74551 100644 --- a/deployment/data-model.nix +++ b/deployment/data-model.nix @@ -17,10 +17,40 @@ let functionType = import ./function.nix; nixops4Deployment = inputs.nixops4.modules.nixops4Deployment.default; + + configuration = mkOption { + description = "Configuration type declaring options to be set by operators"; + type = optionType; + readOnly = true; + default = submoduleWith { + class = "fediversity-configuration"; + modules = [ + { + options = { + enable = lib.mkEnableOption { + description = "your Fediversity configuration"; + }; + applications = lib.mapAttrs ( + _name: application: + mkOption { + description = application.description; + type = submoduleWith { + class = "fediversity-application-config"; + modules = [ application.module ]; + }; + default = { }; + } + ) config.applications; + }; + } + ]; + }; + }; in { _class = "fediversity-settings"; options = { + inherit configuration; resources = mkOption { description = "Collection of deployment resources that can be required by applications and policed by hosting providers"; type = attrsOf (submoduleWith { @@ -126,7 +156,7 @@ in }; readOnly = true; default = { - input-type = application-requirements; + input-type = configuration; output-type = nixops4Deployment; }; }; @@ -153,33 +183,5 @@ in ]; }); }; - configuration = mkOption { - description = "Configuration type declaring options to be set by operators"; - type = optionType; - readOnly = true; - default = submoduleWith { - class = "fediversity-configuration"; - modules = [ - { - options = { - enable = lib.mkEnableOption { - description = "your Fediversity configuration"; - }; - applications = lib.mapAttrs ( - _name: application: - mkOption { - description = application.description; - type = submoduleWith { - class = "fediversity-application-config"; - modules = [ application.module ]; - }; - default = { }; - } - ) config.applications; - }; - } - ]; - }; - }; }; }