From a97d0c5988e38abd1edad9900dee4d08c6f5b081 Mon Sep 17 00:00:00 2001 From: Sigmanificient Date: Sat, 24 Jan 2026 01:23:34 +0100 Subject: [PATCH 1/2] nixosTests.kmscon: init --- nixos/tests/all-tests.nix | 1 + nixos/tests/kmscon.nix | 43 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 44 insertions(+) create mode 100644 nixos/tests/kmscon.nix diff --git a/nixos/tests/all-tests.nix b/nixos/tests/all-tests.nix index 512082e29494..2298d708f46f 100644 --- a/nixos/tests/all-tests.nix +++ b/nixos/tests/all-tests.nix @@ -834,6 +834,7 @@ in kimai = runTest ./kimai.nix; kismet = runTest ./kismet.nix; kmonad = runTest ./kmonad.nix; + kmscon = runTest ./kmscon.nix; knot = runTest ./knot.nix; komga = runTest ./komga.nix; komodo-periphery = runTest ./komodo-periphery.nix; diff --git a/nixos/tests/kmscon.nix b/nixos/tests/kmscon.nix new file mode 100644 index 000000000000..0eb7e941bd84 --- /dev/null +++ b/nixos/tests/kmscon.nix @@ -0,0 +1,43 @@ +{ ... }: +{ + name = "kmscon"; + + nodes.machine = + { + pkgs, + lib, + ... + }: + { + imports = [ + ./common/user-account.nix + ]; + + services.kmscon = { + enable = true; + hwRender = true; + fonts = [ + { + name = "JetBrainsMono Nerd Font"; + package = pkgs.nerd-fonts.jetbrains-mono; + } + ]; + package = pkgs.kmscon; + }; + }; + + enableOCR = true; + + testScript = '' + machine.succeed(":") + # ^ this create a screen + + with subtest("ensure we can open a tty"): + machine.wait_for_text("machine login:") + machine.send_chars("alice\n") + machine.wait_for_text("Password:") + machine.send_chars("foobar\n") + machine.wait_for_text("alice@machine") + machine.screenshot("tty.png") + ''; +} From 47674555a168edbf2d43d506c007119f62d6b8e9 Mon Sep 17 00:00:00 2001 From: Sigmanificient Date: Sat, 24 Jan 2026 01:36:17 +0100 Subject: [PATCH 2/2] kmscon: add nixosTests.kmscon to passthru.tests --- pkgs/by-name/km/kmscon/package.nix | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pkgs/by-name/km/kmscon/package.nix b/pkgs/by-name/km/kmscon/package.nix index d5cf8dd13ee0..61a5d5e7ae97 100644 --- a/pkgs/by-name/km/kmscon/package.nix +++ b/pkgs/by-name/km/kmscon/package.nix @@ -19,6 +19,7 @@ bash, buildPackages, nix-update-script, + nixosTests, }: stdenv.mkDerivation (finalAttrs: { pname = "kmscon"; @@ -63,7 +64,10 @@ stdenv.mkDerivation (finalAttrs: { ./sandbox.patch # Generate system units where they should be (nix store) instead of /etc/systemd/system ]; - passthru.updateScript = nix-update-script { extraArgs = [ "--use-github-releases" ]; }; + passthru = { + tests.kmscon = nixosTests.kmscon; + updateScript = nix-update-script { extraArgs = [ "--use-github-releases" ]; }; + }; meta = { description = "KMS/DRM based System Console";