state-version: migrate to clan.nixosTests module

This commit is contained in:
Jörg Thalheim
2025-06-17 19:33:29 +02:00
parent 41513e6a70
commit 8e2fc1056f
2 changed files with 24 additions and 44 deletions

View File

@@ -1,19 +1,16 @@
{ lib, self, ... }: { lib, ... }:
let
module = lib.modules.importApply ./default.nix { };
in
{ {
clan.modules = { clan.modules.state-version = module;
state-version = lib.modules.importApply ./default.nix { };
};
perSystem = perSystem =
{ pkgs, ... }: { ... }:
{ {
checks = lib.optionalAttrs (pkgs.stdenv.isLinux) { clan.nixosTests.state-version = {
state-version = import ./tests/vm/default.nix { imports = [ ./tests/vm/default.nix ];
inherit pkgs;
clan-core = self; clan.modules."@clan/state-version" = module;
nixosLib = import (self.inputs.nixpkgs + "/nixos/lib") { };
};
}; };
}; };
} }

View File

@@ -1,37 +1,20 @@
{ {
pkgs, name = "state-version";
nixosLib,
clan-core,
...
}:
nixosLib.runTest ( clan = {
{ ... }: directory = ./.;
{ inventory = {
imports = [ machines.server = { };
clan-core.modules.nixosVmTest.clanTest instances.default = {
]; module.name = "@clan/state-version";
roles.default.machines."server" = { };
hostPkgs = pkgs;
name = "state-version";
clan = {
directory = ./.;
modules."@clan/state-version" = ../../default.nix;
inventory = {
machines.server = { };
instances.default = {
module.name = "@clan/state-version";
roles.default.machines."server" = { };
};
}; };
}; };
};
nodes.server = { }; nodes.server = { };
testScript = '' testScript = ''
start_all() start_all()
''; '';
} }
)