Files
nixpkgs/nixos/tests/kmscon.nix
ccicnce113424 9b9e0a021a nixos/kmscon: RFC42 treatment, support version 10.0.0
This commit includes changes from #483195, #523569, and #523955.
2026-05-31 20:34:53 +08:00

51 lines
1.0 KiB
Nix

{ ... }:
{
name = "kmscon";
nodes.machine =
{
pkgs,
...
}:
{
imports = [
./common/user-account.nix
];
services.getty.autologinUser = "alice";
hardware.graphics.enable = true;
fonts = {
fontconfig.enable = true;
packages = [ pkgs.nerd-fonts.jetbrains-mono ];
};
services.kmscon = {
enable = true;
package = pkgs.kmscon;
config = {
font-name = "JetBrainsMono Nerd Font";
hwaccel = true;
term = "kmscon";
};
};
};
enableOCR = true;
testScript = ''
machine.wait_for_unit("default.target")
with subtest("ensure we can open a tty"):
machine.wait_for_text("alice@machine")
machine.send_chars("echo $TERM | tee /tmp/term.txt\n")
machine.wait_until_succeeds("test -s /tmp/term.txt")
term = machine.succeed("cat /tmp/term.txt").strip()
assert term == "kmscon", f"Unexpected TERM value: {term!r}"
machine.screenshot("tty.png")
'';
}