Basic deployment test: Introduce a “flake under test”, overriding /flake.nix

This commit is contained in:
Nicolas Jeannerod 2025-07-03 12:14:13 +02:00
parent c55ee82ba6
commit 7cf43c4041
Signed by: Niols
GPG key ID: 35DB9EC8886E1CB8
3 changed files with 24 additions and 6 deletions

View file

@ -11,9 +11,4 @@
inherit inputs sources; inherit inputs sources;
}; };
}; };
nixops4Deployments.check-deployment-basic = {
imports = [ ./deployment.nix ];
_module.args = { inherit inputs sources; };
};
} }

View file

@ -0,0 +1,22 @@
{
inputs = {
nixops4.follows = "nixops4-nixos/nixops4";
nixops4-nixos.url = "github:nixops4/nixops4-nixos";
};
outputs =
inputs:
import ./mkFlake.nix inputs (
{ inputs, sources, ... }:
{
imports = [
inputs.nixops4.modules.flake.default
];
nixops4Deployments.check-deployment-basic = {
imports = [ ./deployment/check/basic/deployment.nix ];
_module.args = { inherit inputs sources; };
};
}
);
}

View file

@ -134,7 +134,8 @@ in
## NOTE: This is super slow. It could probably be optimised in Nix, for ## NOTE: This is super slow. It could probably be optimised in Nix, for
## instance by allowing to grab things directly from the host's store. ## instance by allowing to grab things directly from the host's store.
with subtest("Override the lock"): with subtest("Override the flake and its lock"):
deployer.succeed("cp ${config.pathFromRoot}/flake-under-test.nix flake.nix")
deployer.succeed(""" deployer.succeed("""
nix flake lock --extra-experimental-features 'flakes nix-command' \ nix flake lock --extra-experimental-features 'flakes nix-command' \
--offline -v \ --offline -v \