Merge pull request #296479 from marcusramberg/marcus/nimdow

nixos/nimdow: module updates
This commit is contained in:
Stig 2024-03-21 12:14:56 +01:00 committed by GitHub
commit 468417b7f3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 43 additions and 6 deletions

View file

@ -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 ];
};
}

View file

@ -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; };

25
nixos/tests/nimdow.nix Normal file
View file

@ -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")
'';
})

View file

@ -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";