allow different deployment types (#498)
Some checks failed
deploy-infra / deploy (push) Successful in 2m20s
/ check-pre-commit (push) Successful in 14s
/ check-data-model (push) Successful in 32s
/ check-mastodon (push) Successful in 23s
/ check-peertube (push) Successful in 22s
/ check-panel (push) Successful in 1m32s
/ check-proxmox-basic (push) Successful in 36s
/ check-deployment-basic (push) Successful in 33s
/ check-deployment-cli (push) Successful in 45s
/ check-resources (push) Waiting to run
/ check-deployment-panel (push) Has been cancelled

Reviewed-on: #498
This commit is contained in:
Kiara Grouwstra 2025-09-03 12:44:44 +02:00
parent 40e8a0a3c5
commit 4049ca8156
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`,