Fediversity/deployment/check/data-model-tf-proxmox/setups/template.nix
Kiara Grouwstra 82a8a121a2
deploy garage
Signed-off-by: Kiara Grouwstra <kiara@procolix.eu>
2025-11-23 13:21:00 +01:00

71 lines
1.7 KiB
Nix

{
config,
system,
modulesPath,
sources ? import ../../../../npins,
...
}:
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
targetSystem
httpBackend
node-name
imageDatastoreId
;
in
(pkgs.callPackage ../../../utils.nix { }).evalModel (
{ config, ... }:
{
imports = [ ../../common/model.nix ];
config = {
environments.default = environment: {
resources."operator-environment".login-shell = {
wheel = true;
username = "operator";
};
implementation =
{
required-resources,
...
}:
{
tf-proxmox-template = {
nixos-configuration = {
imports = [
(mkNixosConfiguration environment required-resources)
./shared.nix
];
};
system = targetSystem;
ssh = {
host = nodeName;
};
inherit
node-name
httpBackend
imageDatastoreId
;
};
};
};
};
options = {
default = mkOption {
type = config.deployment-type;
default = config.environments.default.deployment {
# normally our template is distinct, but our test cannot download build deps due to sandboxing
configuration = config."example-configuration";
};
};
deploy = mkOption {
default = config.default.tf-proxmox-template.run;
};
};
}
)