forked from Fediversity/Fediversity
allow different deployment types
This commit is contained in:
parent
9d903f3ef7
commit
8dc2f05749
2 changed files with 11 additions and 6 deletions
|
@ -13,7 +13,6 @@ let
|
||||||
./data-model.nix
|
./data-model.nix
|
||||||
];
|
];
|
||||||
}).config;
|
}).config;
|
||||||
nixops4Deployment = inputs.nixops4.modules.nixops4Deployment.default;
|
|
||||||
inherit (inputs.nixops4.lib) mkDeployment;
|
inherit (inputs.nixops4.lib) mkDeployment;
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
|
@ -32,7 +31,7 @@ in
|
||||||
expr =
|
expr =
|
||||||
let
|
let
|
||||||
fediversity = eval (
|
fediversity = eval (
|
||||||
{ config, ... }:
|
{ config, options, ... }:
|
||||||
{
|
{
|
||||||
config = {
|
config = {
|
||||||
resources.login-shell = {
|
resources.login-shell = {
|
||||||
|
@ -112,7 +111,7 @@ in
|
||||||
resources.operator-environment.login-shell.username = "operator";
|
resources.operator-environment.login-shell.username = "operator";
|
||||||
implementation = requests: {
|
implementation = requests: {
|
||||||
input = requests;
|
input = requests;
|
||||||
output =
|
output.nixops4 =
|
||||||
{ providers, ... }:
|
{ providers, ... }:
|
||||||
{
|
{
|
||||||
providers = {
|
providers = {
|
||||||
|
@ -145,7 +144,7 @@ in
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
example-deployment = mkOption {
|
example-deployment = mkOption {
|
||||||
type = types.submodule nixops4Deployment;
|
type = options.deployments.nestedType;
|
||||||
readOnly = true;
|
readOnly = true;
|
||||||
default = config.environments.single-nixos-vm.deployment config.example-configuration;
|
default = config.environments.single-nixos-vm.deployment config.example-configuration;
|
||||||
};
|
};
|
||||||
|
|
|
@ -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
|
in
|
||||||
{
|
{
|
||||||
options = {
|
options = {
|
||||||
|
@ -145,12 +151,12 @@ in
|
||||||
type = environment.config.resource-mapping.function-type;
|
type = environment.config.resource-mapping.function-type;
|
||||||
};
|
};
|
||||||
resource-mapping = mkOption {
|
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;
|
type = submodule functionType;
|
||||||
readOnly = true;
|
readOnly = true;
|
||||||
default = {
|
default = {
|
||||||
input-type = application-resources;
|
input-type = application-resources;
|
||||||
output-type = nixops4Deployment;
|
output-type = deployment;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
# TODO(@fricklerhandwerk): maybe this should be a separate thing such as `fediversity-setup`,
|
# TODO(@fricklerhandwerk): maybe this should be a separate thing such as `fediversity-setup`,
|
||||||
|
|
Loading…
Add table
Reference in a new issue