forked from Fediversity/Fediversity
Expose VM options in the flake
This commit is contained in:
parent
10874c995e
commit
4fda719992
1 changed files with 27 additions and 6 deletions
|
@ -56,23 +56,40 @@ let
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
makeResourceConfig =
|
||||||
|
vmName:
|
||||||
|
(evalModules {
|
||||||
|
modules = [
|
||||||
|
nixops4ResourceNixosMockOptions
|
||||||
|
(makeResourceModule vmName)
|
||||||
|
];
|
||||||
|
}).config;
|
||||||
|
|
||||||
makeConfigurations = concatMapAttrs (
|
makeConfigurations = concatMapAttrs (
|
||||||
_: vmNames:
|
_: vmNames:
|
||||||
genAttrs vmNames (
|
genAttrs vmNames (
|
||||||
vmName:
|
vmName:
|
||||||
inputs.nixpkgs.lib.nixosSystem {
|
inputs.nixpkgs.lib.nixosSystem {
|
||||||
modules = [
|
modules = [
|
||||||
(evalModules {
|
(makeResourceConfig vmName).nixos.module
|
||||||
modules = [
|
|
||||||
nixops4ResourceNixosMockOptions
|
|
||||||
(makeResourceModule vmName)
|
|
||||||
];
|
|
||||||
}).config.nixos.module
|
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
makeVmOptions = concatMapAttrs (
|
||||||
|
_: vmNames:
|
||||||
|
genAttrs vmNames (vmName: {
|
||||||
|
inherit ((makeResourceConfig vmName).fediversityVm)
|
||||||
|
proxmox
|
||||||
|
vmId
|
||||||
|
sockets
|
||||||
|
cores
|
||||||
|
memory
|
||||||
|
;
|
||||||
|
})
|
||||||
|
);
|
||||||
|
|
||||||
machines = {
|
machines = {
|
||||||
git = [
|
git = [
|
||||||
"vm02116"
|
"vm02116"
|
||||||
|
@ -94,6 +111,10 @@ in
|
||||||
{
|
{
|
||||||
flake.lib.makeInstallerIso = import ./makeInstallerIso.nix;
|
flake.lib.makeInstallerIso = import ./makeInstallerIso.nix;
|
||||||
|
|
||||||
|
## REVIEW: It would probably make more sense to have the VM names as parent of
|
||||||
|
## the corresponding resource, NixOS configuration, and VM options, rather
|
||||||
|
## than the contrary.
|
||||||
nixops4Deployments = makeDeployments (addDefaultDeployment machines);
|
nixops4Deployments = makeDeployments (addDefaultDeployment machines);
|
||||||
flake.nixosConfigurations = makeConfigurations machines;
|
flake.nixosConfigurations = makeConfigurations machines;
|
||||||
|
flake.vmOptions = makeVmOptions machines;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue