expose deployment type

Signed-off-by: Kiara Grouwstra <kiara@procolix.eu>
This commit is contained in:
Kiara Grouwstra 2025-11-22 15:47:30 +01:00
parent 6761c2d61f
commit adb695a9f0
Signed by: kiara
SSH key fingerprint: SHA256:COspvLoLJ5WC5rFb9ZDe5urVCkK4LJZOsjfF4duRJFU
7 changed files with 39 additions and 48 deletions

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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