forked from Fediversity/Fediversity
Co-authored-by: Nicolas “Niols” Jeannerod <nicolas.jeannerod@moduscreate.com> Reviewed-on: Fediversity/Fediversity#421 Reviewed-by: Nicolas Jeannerod <nicolas.jeannerod@moduscreate.com> Reviewed-by: Valentin Gagarin <valentin.gagarin@tweag.io> Co-authored-by: Kiara Grouwstra <kiara@procolix.eu> Co-committed-by: Kiara Grouwstra <kiara@procolix.eu>
57 lines
1.2 KiB
Nix
57 lines
1.2 KiB
Nix
{
|
|
self,
|
|
inputs,
|
|
lib,
|
|
sources,
|
|
...
|
|
}:
|
|
|
|
let
|
|
inherit (lib) genAttrs;
|
|
|
|
targetMachines = [
|
|
"hello"
|
|
"cowsay"
|
|
];
|
|
pathToRoot = /. + (builtins.unsafeDiscardStringContext self);
|
|
pathFromRoot = ./.;
|
|
|
|
in
|
|
{
|
|
_class = "flake";
|
|
|
|
perSystem =
|
|
{ pkgs, ... }:
|
|
{
|
|
checks.deployment-basic = pkgs.testers.runNixOSTest {
|
|
imports = [
|
|
../common/nixosTest.nix
|
|
./nixosTest.nix
|
|
];
|
|
_module.args = { inherit inputs sources; };
|
|
inherit targetMachines pathToRoot pathFromRoot;
|
|
};
|
|
};
|
|
|
|
nixops4Deployments.check-deployment-basic =
|
|
{ providers, ... }:
|
|
{
|
|
providers = {
|
|
inherit (inputs.nixops4.modules.nixops4Provider) local;
|
|
};
|
|
resources = genAttrs targetMachines (nodeName: {
|
|
type = providers.local.exec;
|
|
imports = [
|
|
inputs.nixops4-nixos.modules.nixops4Resource.nixos
|
|
../common/targetResource.nix
|
|
];
|
|
_module.args = { inherit inputs sources; };
|
|
inherit nodeName pathToRoot pathFromRoot;
|
|
nixos.module =
|
|
{ pkgs, ... }:
|
|
{
|
|
environment.systemPackages = [ pkgs.${nodeName} ];
|
|
};
|
|
});
|
|
};
|
|
}
|