dotfiles/nixos/tests/default.nix

39 lines
792 B
Nix
Raw Normal View History

{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
'';
};
};
}