mirror of
https://github.com/nix-community/srvos.git
synced 2024-09-11 14:17:02 +03:00
36 lines
893 B
Nix
36 lines
893 B
Nix
{ prefix, self, pkgs }:
|
|
let
|
|
lib = pkgs.lib;
|
|
system = pkgs.system;
|
|
|
|
nixosTest = import "${pkgs.path}/nixos/lib/testing-python.nix" {
|
|
inherit pkgs system;
|
|
};
|
|
|
|
moduleTests = {
|
|
"${prefix}-server" = nixosTest.makeTest {
|
|
name = "${prefix}-server";
|
|
|
|
nodes.machine = { ... }: {
|
|
imports = [ self.nixosModules.server ];
|
|
networking.hostName = "machine";
|
|
};
|
|
testScript = ''
|
|
machine.wait_for_unit("sshd.service")
|
|
# TODO: what else to test for?
|
|
'';
|
|
};
|
|
};
|
|
|
|
configurations = import ./test-configurations.nix {
|
|
inherit self pkgs;
|
|
};
|
|
|
|
# Add all the nixos configurations to the checks
|
|
nixosChecks =
|
|
lib.mapAttrs'
|
|
(name: value: { name = "${prefix}-${name}"; value = value.config.system.build.toplevel; })
|
|
(lib.filterAttrs (_name: value: value != null) configurations);
|
|
in
|
|
nixosChecks // moduleTests
|