From 27149a9a88d69d74903ee26bb30973154dc2c737 Mon Sep 17 00:00:00 2001 From: Kiara Grouwstra Date: Sat, 9 Aug 2025 12:50:22 +0200 Subject: [PATCH] allow different deployment types --- deployment/data-model-test.nix | 7 +++---- deployment/data-model.nix | 10 ++++++++-- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/deployment/data-model-test.nix b/deployment/data-model-test.nix index 24d5cd6c..c65e37ae 100644 --- a/deployment/data-model-test.nix +++ b/deployment/data-model-test.nix @@ -13,7 +13,6 @@ let ./data-model.nix ]; }).config; - nixops4Deployment = inputs.nixops4.modules.nixops4Deployment.default; inherit (inputs.nixops4.lib) mkDeployment; in { @@ -32,7 +31,7 @@ in expr = let fediversity = eval ( - { config, ... }: + { config, options, ... }: { config = { resources.login-shell = { @@ -112,7 +111,7 @@ in resources.operator-environment.login-shell.username = "operator"; implementation = requests: { input = requests; - output = + output.nixops4 = { providers, ... }: { providers = { @@ -145,7 +144,7 @@ in }; }; example-deployment = mkOption { - type = types.submodule nixops4Deployment; + type = options.deployments.nestedType; readOnly = true; default = config.environments.single-nixos-vm.deployment config.example-configuration; }; diff --git a/deployment/data-model.nix b/deployment/data-model.nix index c3d5d53a..412f9bae 100644 --- a/deployment/data-model.nix +++ b/deployment/data-model.nix @@ -39,6 +39,12 @@ let } ]; }; + deployment = attrTag { + nixops4 = mkOption { + description = "A NixOps4 NixOS deployment. For an example, see https://github.com/nixops4/nixops4-nixos/blob/main/example/deployment.nix."; + type = nixops4Deployment; + }; + }; in { options = { @@ -145,12 +151,12 @@ in type = environment.config.resource-mapping.function-type; }; resource-mapping = mkOption { - description = "Function type for the mapping from resources to a (NixOps4) deployment"; + description = "Function type for the mapping from resources to a deployment"; type = submodule functionType; readOnly = true; default = { input-type = application-resources; - output-type = nixops4Deployment; + output-type = deployment; }; }; # TODO(@fricklerhandwerk): maybe this should be a separate thing such as `fediversity-setup`,