allow different deployment types

This commit is contained in:
Kiara Grouwstra 2025-08-09 12:50:22 +02:00
parent 9c219341b1
commit 478c07df31
Signed by: kiara
SSH key fingerprint: SHA256:COspvLoLJ5WC5rFb9ZDe5urVCkK4LJZOsjfF4duRJFU
2 changed files with 11 additions and 6 deletions

View file

@ -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;
};

View file

@ -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`,