Basic deployment test: Introduce a “flake under test”, overriding /flake.nix
This commit is contained in:
parent
c55ee82ba6
commit
7cf43c4041
3 changed files with 24 additions and 6 deletions
|
@ -11,9 +11,4 @@
|
||||||
inherit inputs sources;
|
inherit inputs sources;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
nixops4Deployments.check-deployment-basic = {
|
|
||||||
imports = [ ./deployment.nix ];
|
|
||||||
_module.args = { inherit inputs sources; };
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
22
deployment/check/basic/flake-under-test.nix
Normal file
22
deployment/check/basic/flake-under-test.nix
Normal 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; };
|
||||||
|
};
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
|
@ -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 \
|
||||||
|
|
Loading…
Add table
Reference in a new issue