dotfiles/nixos/tests/default.nix
magic_rb cc362a70e4
Add NixOS tests test
Signed-off-by: magic_rb <magic_rb@redalder.org>
2024-07-25 14:50:50 +02:00

39 lines
792 B
Nix

{self, ...}: {
perSystem = {pkgs, ...}: {
checks.router = pkgs.stdenv.mkDerivation {
name = "router";
phases = [
"runPhase"
];
env.ROUTER_CMD =
(self.nixosConfigurations.liveusb.extendModules {
modules = [
"${pkgs.path}/nixos/modules/testing/test-instrumentation.nix"
];
})
.config
.system
.build
.vm;
nativeBuildInputs = with pkgs; [
iproute2
(python3.withPackages (ps:
with ps; [
ptpython
colorama
junit-xml
]))
];
runPhase = ''
PYTHONPATH=${pkgs.path}/nixos/lib/test-driver python ${./router.py}
mkdir -p $out
touch $out/success
'';
};
};
}