dynix/tests/default.nix

50 lines
1.7 KiB
Nix
Raw Normal View History

2026-02-06 17:12:02 +01:00
{
pkgs ? import <nixpkgs> { },
2026-02-09 14:32:56 +01:00
qpkgs ? let
src = fetchTree (builtins.parseFlakeRef "github:Qyriad/nur-packages");
in import src { inherit pkgs; },
lib ? qpkgs.lib,
2026-02-11 13:16:54 +01:00
dynix ? qpkgs.callPackage ../package.nix { },
2026-02-09 14:32:56 +01:00
}: let
runDynixTest = testModule: pkgs.testers.runNixOSTest {
imports = [ testModule ];
# Why is this argument called "extraBaseModule**s**" but take a single module argument...
2026-02-10 14:59:44 +01:00
# Also note this is an extra base module for each node of the test,
# not an extra test module.
extraBaseModules = { name, config, options, modulesPath, ... }: {
imports = (import "${modulesPath}/module-list.nix") ++ [
./module-allow-rebuild-in-vm.nix
"${modulesPath}/testing/test-instrumentation.nix"
(toString dynix)
];
environment.systemPackages = [ dynix ];
systemd.services."install-dynix" = {
enable = true;
serviceConfig.Type = "oneshot";
serviceConfig.RemainAfterExit = true;
path = [ config.system.path ];
wantedBy = [ "multi-user.target" ];
after = [ "default.target" ];
script = ''
nix profile install -vv "$(realpath /run/current-system/sw/share/nixos/modules/dynix/)"
'';
};
passthru = { inherit options; };
2026-02-09 14:32:56 +01:00
# Just making something in this strict in `name`,
# which is only present as an argument for nodes and I don't want to
# confuse that with the test modules.
2026-02-10 14:59:44 +01:00
warnings = builtins.seq name [ ];
2026-02-09 14:32:56 +01:00
};
};
in lib.makeScope lib.callPackageWith (self: {
2026-02-10 14:19:55 +01:00
gotosocial = runDynixTest ./gotosocial/test.nix;
2026-02-10 14:59:44 +01:00
harmonia = runDynixTest ./harmonia/test.nix;
#tzupdate = runDynixTest ./tzupdate/test.nix;
2026-02-06 17:12:02 +01:00
})