Unverified Commit eb2d8980 authored by Yohann Boniface's avatar Yohann Boniface Committed by GitHub
Browse files

nixosTests.kmscon: init (#483223)

parents 16f9cd99 47674555
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -837,6 +837,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;

nixos/tests/kmscon.nix

0 → 100644
+43 −0
Original line number Diff line number Diff line
{ ... }:
{
  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")
  '';
}
+5 −1
Original line number Diff line number Diff line
@@ -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";