forked from Fediversity/Fediversity
This PR adds a basic deployment test to the repository. This test will, in a NixOS test, run a deployer VM and a target VM, and check that we manage to run `nixops4 apply` on the deployer VM to change things on the target VM. The ideas are all @roberth's and this test has been extremely heavily inspired by https://github.com/nixops4/nixops4-nixos/blob/main/test/default/nixosTest.nix. Reviewed-on: Fediversity/Fediversity#323 Reviewed-by: Valentin Gagarin <valentin.gagarin@tweag.io> Co-authored-by: Nicolas “Niols” Jeannerod <nicolas.jeannerod@moduscreate.com> Co-committed-by: Nicolas “Niols” Jeannerod <nicolas.jeannerod@moduscreate.com>
35 lines
796 B
Nix
35 lines
796 B
Nix
{
|
|
lib,
|
|
modulesPath,
|
|
...
|
|
}:
|
|
|
|
{
|
|
imports = [
|
|
(modulesPath + "/profiles/qemu-guest.nix")
|
|
(modulesPath + "/../lib/testing/nixos-test-base.nix")
|
|
];
|
|
|
|
## Test framework disables switching by default. That might be OK by itself,
|
|
## but we also use this config for getting the dependencies in
|
|
## `deployer.system.extraDependencies`.
|
|
system.switch.enable = true;
|
|
|
|
nix = {
|
|
## Not used; save a large copy operation
|
|
channel.enable = false;
|
|
registry = lib.mkForce { };
|
|
};
|
|
|
|
services.openssh = {
|
|
enable = true;
|
|
settings.PermitRootLogin = "yes";
|
|
};
|
|
|
|
networking.firewall.allowedTCPPorts = [ 22 ];
|
|
|
|
users.users.root.openssh.authorizedKeys.keyFiles = [ ./deployer.pub ];
|
|
|
|
## Test VMs don't have a bootloader by default.
|
|
boot.loader.grub.enable = false;
|
|
}
|