A simple flake setup with tests and VM support

This commit is contained in:
Henrik
2025-10-09 22:31:48 +02:00
parent cc3a2ed192
commit 814d54bcf4
11 changed files with 399 additions and 0 deletions

25
nix/tests/test1.nix Normal file
View File

@@ -0,0 +1,25 @@
{ pkgs ? import <nixpkgs> {} }:
pkgs.nixosTest {
name = "matrix-login-test";
nodes = {
machine = { config, pkgs, ... }: {
imports = [
../configuration.nix
];
# Test configuration
virtualisation.memorySize = 2048;
};
};
testScript = ''
start_all()
machine.wait_for_unit("multi-user.target")
with subtest("SSH service test"):
machine.wait_for_unit("sshd.service")
machine.wait_for_open_port(22)
'';
}