forked from Fediversity/Fediversity
Extract resource module from makeDeployments
This commit is contained in:
parent
398dc05ad5
commit
df78965bf4
1 changed files with 10 additions and 4 deletions
|
@ -11,20 +11,26 @@ let
|
|||
addDefaultDeployment =
|
||||
deployments: deployments // { default = concatLists (attrValues deployments); };
|
||||
|
||||
makeResourceModule = vmName: {
|
||||
_module.args = { inherit inputs; };
|
||||
imports = [
|
||||
./common/resource.nix
|
||||
(./. + "/${vmName}")
|
||||
];
|
||||
procolixVm.name = vmName;
|
||||
};
|
||||
|
||||
makeDeployments = mapAttrs (
|
||||
_: vmNames:
|
||||
{ providers, ... }:
|
||||
{
|
||||
providers.local = inputs.nixops4.modules.nixops4Provider.local;
|
||||
resources = genAttrs vmNames (vmName: {
|
||||
_module.args = { inherit inputs; };
|
||||
type = providers.local.exec;
|
||||
imports = [
|
||||
inputs.nixops4-nixos.modules.nixops4Resource.nixos
|
||||
./common/resource.nix
|
||||
(./. + "/${vmName}")
|
||||
(makeResourceModule vmName)
|
||||
];
|
||||
procolixVm.name = vmName;
|
||||
});
|
||||
}
|
||||
);
|
||||
|
|
Loading…
Add table
Reference in a new issue