forked from fediversity/fediversity
69 lines
1.6 KiB
Nix
69 lines
1.6 KiB
Nix
{
|
|
config,
|
|
system,
|
|
modulesPath,
|
|
sources ? import ../../../../npins,
|
|
...
|
|
}:
|
|
let
|
|
inherit (sources) nixpkgs;
|
|
pkgs = import nixpkgs { inherit system; };
|
|
inherit (pkgs) lib;
|
|
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 =
|
|
let
|
|
env = config.environments.default;
|
|
in
|
|
lib.mkOption {
|
|
type = env.resource-mapping.output-type;
|
|
default = env.deployment {
|
|
deployment-name = "default";
|
|
configuration = config."example-configuration";
|
|
};
|
|
};
|
|
}
|
|
)
|