diff --git a/deployment/data-model-test.nix b/deployment/data-model-test.nix index 9163eafb..55a0e1d8 100644 --- a/deployment/data-model-test.nix +++ b/deployment/data-model-test.nix @@ -16,41 +16,50 @@ in test-eval = { expr = let - example = eval { - runtime-configurations.single-ssh-host = - { ... }: - { - system.stateVersion = "25.05"; - }; - runtime-environments.bar = { - single-ssh-host = { - ssh = { - host = "localhost"; - username = "root"; - authentication.password = ""; - }; - }; - }; - applications.foo = { - module = - { pkgs, ... }: + example = eval ( + { config, ... }: + { + runtime-configurations.single-ssh-host = + { ... }: { - environment.systemPackages = [ - pkgs.hello - ]; + system.stateVersion = "25.05"; }; - }; - }; + runtime-environments.bar = { + single-ssh-host = { + ssh = { + host = "localhost"; + username = "root"; + authentication.password = ""; + }; + }; + }; + applications.foo = { + module = + { pkgs, ... }: + { + environment.systemPackages = [ + pkgs.hello + ]; + }; + }; + deployments.baz = { + module = { }; + runtime-environment = config.runtime-environments.bar; + }; + } + ); in { has-runtime-configuration = lib.isAttrs example.runtime-configurations.single-ssh-host; has-runtime-environment = lib.isAttrs example.runtime-environments.bar.single-ssh-host.module; has-application = lib.isAttrs example.applications.foo.module; + has-deployment = lib.isAttrs example.deployments.baz.module; }; expected = { has-runtime-configuration = true; has-runtime-environment = true; has-application = true; + has-deployment = true; }; }; } diff --git a/deployment/data-model.nix b/deployment/data-model.nix index e0ed15c2..2a90fc11 100644 --- a/deployment/data-model.nix +++ b/deployment/data-model.nix @@ -107,6 +107,26 @@ let } ]; }; + deployment = submoduleWith { + description = "A deployment of a configuration of applications to a run-time environment"; + modules = [ + { + options = { + # the `applications` option consists of configuration for the above applications + module = mkOption { + description = '' + Configuration to be deployed + ''; + type = deferredModule; + }; + runtime-environment = mkOption { + description = "The run-time environment to deploy to"; + type = runtime-environment; + }; + }; + } + ]; + }; in { options = { @@ -122,5 +142,9 @@ in description = "Collection of Fediversity applications"; type = attrsOf application; }; + deployments = mkOption { + description = "Deployment of a configuration of applications to a run-time environment"; + type = attrsOf deployment; + }; }; }