expose deployment type (#596)

Reviewed-on: fediversity/fediversity#596
This commit is contained in:
Kiara Grouwstra 2025-11-22 17:53:31 +01:00
parent 6761c2d61f
commit a71b6a18dc
7 changed files with 39 additions and 48 deletions

View file

@ -18,13 +18,9 @@ in
{
imports = [ ../common/model.nix ];
options = {
default =
let
env = config.environments.default;
in
mkOption {
type = env.resource-mapping.output-type;
default = env.deployment {
default = mkOption {
type = config.deployment-type;
default = config.environments.default.deployment {
deployment-name = "default";
configuration = config."example-configuration";
};

View file

@ -55,13 +55,9 @@ in
};
};
};
options.default =
let
env = config.environments.default;
in
lib.mkOption {
type = env.resource-mapping.output-type;
default = env.deployment {
options.default = lib.mkOption {
type = config.deployment-type;
default = config.environments.default.deployment {
deployment-name = "default";
configuration = config."example-configuration";
};

View file

@ -9,6 +9,7 @@ let
inherit (sources) nixpkgs;
pkgs = import nixpkgs { inherit system; };
inherit (pkgs) lib;
inherit (lib) mkOption;
inherit (pkgs.callPackage ../common/utils.nix { inherit modulesPath; }) mkNixosConfiguration;
inherit (config)
nodeName
@ -52,16 +53,14 @@ in
};
};
};
options.default =
let
env = config.environments.default;
in
lib.mkOption {
type = env.resource-mapping.output-type;
default = env.deployment {
options = {
default = mkOption {
type = config.deployment-type;
default = config.environments.default.deployment {
deployment-name = "default";
configuration = config."example-configuration";
};
};
};
}
)

View file

@ -9,6 +9,7 @@ let
inherit (sources) nixpkgs;
pkgs = import nixpkgs { inherit system; };
inherit (pkgs) lib;
inherit (lib) mkOption;
inherit (pkgs.callPackage ../../common/utils.nix { inherit modulesPath; }) mkNixosConfiguration;
inherit (config)
nodeName
@ -54,17 +55,15 @@ in
};
};
};
options.default =
let
env = config.environments.default;
in
lib.mkOption {
type = env.resource-mapping.output-type;
default = env.deployment {
options = {
default = mkOption {
type = config.deployment-type;
default = config.environments.default.deployment {
deployment-name = "default";
# normally our template is distinct, but our test cannot download build deps due to sandboxing
configuration = config."example-configuration";
};
};
};
}
)

View file

@ -9,6 +9,7 @@ let
inherit (sources) nixpkgs;
pkgs = import nixpkgs { inherit system; };
inherit (pkgs) lib;
inherit (lib) mkOption;
inherit (pkgs.callPackage ../../common/utils.nix { inherit modulesPath; }) mkNixosConfiguration;
inherit (config)
nodeName
@ -81,16 +82,14 @@ in
};
};
};
options.default =
let
env = config.environments.default;
in
lib.mkOption {
type = env.resource-mapping.output-type;
default = env.deployment {
options = {
default = mkOption {
type = config.deployment-type;
default = config.environments.default.deployment {
deployment-name = "default";
configuration = config."example-configuration";
};
};
};
}
)

View file

@ -9,6 +9,7 @@ let
inherit (sources) nixpkgs;
pkgs = import nixpkgs { inherit system; };
inherit (pkgs) lib;
inherit (lib) mkOption;
inherit (pkgs.callPackage ../common/utils.nix { inherit modulesPath; }) mkNixosConfiguration;
inherit (config)
nodeName
@ -52,16 +53,14 @@ in
};
};
};
options.default =
let
env = config.environments.default;
in
lib.mkOption {
type = env.resource-mapping.output-type;
default = env.deployment {
options = {
default = mkOption {
type = config.deployment-type;
default = config.environments.default.deployment {
deployment-name = "default";
configuration = config."example-configuration";
};
};
};
}
)

View file

@ -32,6 +32,9 @@ let
in
{
options = {
deployment-type = mkOption {
default = deployment-type;
};
resources = mkOption {
description = "Collection of deployment resources that can be required by applications and policed by hosting providers";
type = attrsOf (