nixinate/tests/vmTest/nixinateeBase.nix
matthewcroughan 971bfe5d1f Add vmTest for Nixinate
This initializes ./test/default.nix which is referred to by the
flake.nix under the `checks` attribute. This default.nix should point to
all future tests, where they can be looked up and ran like:

nix build .#checks.x86_64-linux.vmTest

The test included is a simple NixOS VM Test. It uses Nixinate to deploy
a machine with `services.nginx.enable = true` set, and tests whether
nginx.service is started and reachable after deployment.
2022-04-19 05:43:22 +01:00

32 lines
746 B
Nix

# Common configuration of nixinatee node in the vmTest. This is the base
# configuration which is required to perform the test.
{
config = {
nix.trustedUsers = [ "nixinator" ];
security.sudo.extraRules = [{
users = [ "nixinator" ];
commands = [{
command = "ALL";
options = [ "NOPASSWD" ];
}];
}];
users = {
mutableUsers = false;
users = {
nixinator = {
extraGroups = [
"wheel"
];
password = "";
isNormalUser = true;
};
};
};
services.openssh = {
enable = true;
extraConfig = "PermitEmptyPasswords yes";
};
documentation.enable = false;
boot.loader.grub.enable = false;
};
}