users: migrate to clan.nixosTests module

This commit is contained in:
Jörg Thalheim
2025-06-17 19:35:16 +02:00
parent d31c9d1537
commit 9cefd70bf8
2 changed files with 45 additions and 64 deletions

View File

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

View File

@@ -1,24 +1,8 @@
{
pkgs,
nixosLib,
clan-core,
...
}:
nixosLib.runTest (
{ ... }:
{
imports = [
clan-core.modules.nixosVmTest.clanTest
];
hostPkgs = pkgs;
name = "users";
clan = {
directory = ./.;
modules."@clan/users" = ../../default.nix;
inventory = {
machines.server = { };
@@ -63,5 +47,4 @@ nixosLib.runTest (
# server.succeed(f"echo '{password}' | su - testuser -c 'echo Login successful'")
'';
}
)
}