diff --git a/nixos/modules/services/x11/window-managers/nimdow.nix b/nixos/modules/services/x11/window-managers/nimdow.nix index de3192876024..9cee4bb271a5 100644 --- a/nixos/modules/services/x11/window-managers/nimdow.nix +++ b/nixos/modules/services/x11/window-managers/nimdow.nix @@ -8,16 +8,23 @@ in { options = { services.xserver.windowManager.nimdow.enable = mkEnableOption (lib.mdDoc "nimdow"); + services.xserver.windowManager.nimdow.package = mkOption { + type = types.package; + default = pkgs.nimdow; + defaultText = "pkgs.nimdow"; + description = lib.mdDoc "nimdow package to use"; + }; }; + config = mkIf cfg.enable { services.xserver.windowManager.session = singleton { name = "nimdow"; start = '' - ${pkgs.nimdow}/bin/nimdow & + ${cfg.package}/bin/nimdow & waitPID=$! ''; }; - environment.systemPackages = [ pkgs.nimdow ]; + environment.systemPackages = [ cfg.package pkgs.st ]; }; } diff --git a/nixos/tests/all-tests.nix b/nixos/tests/all-tests.nix index c57fb74a01e7..f713e3bfdc6f 100644 --- a/nixos/tests/all-tests.nix +++ b/nixos/tests/all-tests.nix @@ -582,6 +582,7 @@ in { ndppd = handleTest ./ndppd.nix {}; nebula = handleTest ./nebula.nix {}; netbird = handleTest ./netbird.nix {}; + nimdow = handleTest ./nimdow.nix {}; neo4j = handleTest ./neo4j.nix {}; netdata = handleTest ./netdata.nix {}; networking.networkd = handleTest ./networking.nix { networkd = true; }; diff --git a/nixos/tests/nimdow.nix b/nixos/tests/nimdow.nix new file mode 100644 index 000000000000..cefe46edc5fb --- /dev/null +++ b/nixos/tests/nimdow.nix @@ -0,0 +1,25 @@ +import ./make-test-python.nix ({ pkgs, ...} : { + name = "nimdow"; + meta = with pkgs.lib.maintainers; { + maintainers = [ marcusramberg ]; + }; + + nodes.machine = { lib, ... }: { + imports = [ ./common/x11.nix ./common/user-account.nix ]; + test-support.displayManager.auto.user = "alice"; + services.xserver.displayManager.defaultSession = lib.mkForce "none+nimdow"; + services.xserver.windowManager.nimdow.enable = true; + }; + + testScript = { ... }: '' + with subtest("ensure x starts"): + machine.wait_for_x() + machine.wait_for_file("/home/alice/.Xauthority") + machine.succeed("xauth merge ~alice/.Xauthority") + + with subtest("ensure we can open a new terminal"): + machine.send_key("meta_l-ret") + machine.wait_for_window(r"alice.*?machine") + machine.screenshot("terminal") + ''; +}) diff --git a/pkgs/by-name/ni/nimdow/package.nix b/pkgs/by-name/ni/nimdow/package.nix index a77fb05298b7..7a5542c2c05f 100644 --- a/pkgs/by-name/ni/nimdow/package.nix +++ b/pkgs/by-name/ni/nimdow/package.nix @@ -1,4 +1,4 @@ -{ lib, buildNimPackage, fetchFromGitHub, testers }: +{ lib, buildNimPackage, fetchFromGitHub, nixosTests, testers }: buildNimPackage (finalAttrs: { pname = "nimdow"; @@ -25,14 +25,18 @@ buildNimPackage (finalAttrs: { substituteInPlace src/nimdowpkg/config/configloader.nim --replace "/usr/share/nimdow" "$out/share/nimdow" ''; - passthru.tests.version = testers.testVersion { - package = finalAttrs.finalPackage; - version = "v${finalAttrs.version}"; + passthru.tests = { + nimdow = nixosTests.nimdow; + version = testers.testVersion { + package = finalAttrs.finalPackage; + version = "v${finalAttrs.version}"; + }; }; meta = with lib; finalAttrs.src.meta // { description = "Nim based tiling window manager"; + platforms = platforms.linux; license = [ licenses.gpl2 ]; maintainers = [ maintainers.marcusramberg ]; mainProgram = "nimdow";