Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add package wmderland #101852

Merged
merged 3 commits into from
Apr 12, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions maintainers/maintainer-list.nix
Original file line number Diff line number Diff line change
Expand Up @@ -8403,6 +8403,12 @@
githubId = 321799;
name = "Paul Colomiets";
};
takagiy = {
SuperSandro2000 marked this conversation as resolved.
Show resolved Hide resolved
email = "takagiy.4dev@gmail.com";
github = "takagiy";
githubId = 18656090;
name = "Yuki Takagi";
};
taketwo = {
email = "alexandrov88@gmail.com";
github = "taketwo";
Expand Down
1 change: 1 addition & 0 deletions nixos/modules/services/x11/window-managers/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ in
./tinywm.nix
./twm.nix
./windowmaker.nix
./wmderland.nix
./wmii.nix
./xmonad.nix
./yeahwm.nix
Expand Down
61 changes: 61 additions & 0 deletions nixos/modules/services/x11/window-managers/wmderland.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
{ config, lib, pkgs, ... }:

with lib;

let
cfg = config.services.xserver.windowManager.wmderland;
in

{
options.services.xserver.windowManager.wmderland = {
enable = mkEnableOption "wmderland";

extraSessionCommands = mkOption {
default = "";
type = types.lines;
description = ''
Shell commands executed just before wmderland is started.
'';
};

extraPackages = mkOption {
type = with types; listOf package;
default = with pkgs; [
rofi
dunst
light
hsetroot
feh
rxvt-unicode
];
example = literalExample ''
with pkgs; [
rofi
dunst
light
hsetroot
feh
rxvt-unicode
]
'';
description = ''
Extra packages to be installed system wide.
'';
};
};

config = mkIf cfg.enable {
services.xserver.windowManager.session = singleton {
name = "wmderland";
start = ''
${cfg.extraSessionCommands}

${pkgs.wmderland}/bin/wmderland &
waitPID=$!
'';
};
environment.systemPackages = [
pkgs.wmderland pkgs.wmderlandc
] ++ cfg.extraPackages;
};
}
1 change: 1 addition & 0 deletions nixos/tests/all-tests.nix
Original file line number Diff line number Diff line change
Expand Up @@ -371,6 +371,7 @@ in
virtualbox = handleTestOn ["x86_64-linux"] ./virtualbox.nix {};
wasabibackend = handleTest ./wasabibackend.nix {};
wireguard = handleTest ./wireguard {};
wmderland = handleTest ./wmderland.nix {};
wordpress = handleTest ./wordpress.nix {};
xandikos = handleTest ./xandikos.nix {};
xautolock = handleTest ./xautolock.nix {};
Expand Down
54 changes: 54 additions & 0 deletions nixos/tests/wmderland.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
import ./make-test-python.nix ({ pkgs, ...} : {
name = "wmderland";
meta = with pkgs.stdenv.lib.maintainers; {
maintainers = [ takagiy ];
};

machine = { lib, ... }: {
imports = [ ./common/x11.nix ./common/user-account.nix ];
test-support.displayManager.auto.user = "alice";
services.xserver.displayManager.defaultSession = lib.mkForce "none+wmderland";
services.xserver.windowManager.wmderland.enable = true;

systemd.services.setupWmderlandConfig = {
wantedBy = [ "multi-user.target" ];
before = [ "multi-user.target" ];
environment = {
HOME = "/home/alice";
};
unitConfig = {
type = "oneshot";
RemainAfterExit = true;
user = "alice";
};
script = let
config = pkgs.writeText "config" ''
set $Mod = Mod1
bindsym $Mod+Return exec ${pkgs.xterm}/bin/xterm -cm -pc
'';
in ''
mkdir -p $HOME/.config/wmderland
cp ${config} $HOME/.config/wmderland/config
'';
};
};

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("alt-ret")
machine.wait_until_succeeds("pgrep xterm")
machine.wait_for_window(r"alice.*?machine")
machine.screenshot("terminal")

with subtest("ensure we can communicate through ipc with wmderlandc"):
# Kills the previously open xterm
machine.succeed("pgrep xterm")
machine.execute("DISPLAY=:0 wmderlandc kill")
machine.fail("pgrep xterm")
'';
})
13 changes: 13 additions & 0 deletions pkgs/applications/window-managers/wmderland/0001-remove-flto.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 17a4944..33406f3 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -10,7 +10,7 @@ include(BuildType)
# Request C++14 standard, using new CMake variables.
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED True)
-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -flto -Wall")
+set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could have used substituteInPlace for this but you don't need to change it.


# If the BuildType is Debug, then add -rdynamic.
# (used to print stacktrace with function names)
49 changes: 49 additions & 0 deletions pkgs/applications/window-managers/wmderland/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
{ lib, stdenv, fetchFromGitHub, cmake, libnotify, libX11, xorgproto, nixosTests }:

stdenv.mkDerivation {
pname = "wmderland";
version = "unstable-2020-07-17";

src = fetchFromGitHub {
owner = "aesophor";
repo = "wmderland";
rev = "a40a3505dd735b401d937203ab6d8d1978307d72";
sha256 = "0npmlnybblp82mfpinjbz7dhwqgpdqc1s63wc1zs8mlcs19pdh98";
};

nativeBuildInputs = [
cmake
];

cmakeBuildType = "MinSizeRel";

patches = [ ./0001-remove-flto.patch ];

postPatch = ''
substituteInPlace src/util.cc \
--replace "notify-send" "${libnotify}/bin/notify-send"
'';

buildInputs = [
libX11
xorgproto
];

postInstall = ''
install -Dm0644 -t $out/share/wmderland/contrib $src/example/config
install -Dm0644 -t $out/share/xsessions $src/example/wmderland.desktop
'';

passthru = {
tests.basic = nixosTests.wmderland;
providedSessions = [ "wmderland" ];
};

meta = with lib; {
description = "Modern and minimal X11 tiling window manager";
homepage = "https://github.com/aesophor/wmderland";
license = licenses.mit;
platforms = libX11.meta.platforms;
maintainers = with maintainers; [ takagiy ];
};
}
32 changes: 32 additions & 0 deletions pkgs/applications/window-managers/wmderlandc/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{ lib, stdenv, fetchFromGitHub, cmake, libX11, xorgproto }:

stdenv.mkDerivation {
pname = "wmderlandc";
version = "unstable-2020-07-17";

src = fetchFromGitHub {
owner = "aesophor";
repo = "wmderland";
rev = "a40a3505dd735b401d937203ab6d8d1978307d72";
sha256 = "0npmlnybblp82mfpinjbz7dhwqgpdqc1s63wc1zs8mlcs19pdh98";
};

sourceRoot = "source/ipc-client";

nativeBuildInputs = [
cmake
];

buildInputs = [
libX11
xorgproto
];

meta = with lib; {
description = "A tiny program to interact with wmderland";
homepage = "https://github.com/aesophor/wmderland/tree/master/ipc-client";
license = licenses.mit;
platforms = platforms.all;
maintainers = with maintainers; [ takagiy ];
};
}
4 changes: 4 additions & 0 deletions pkgs/top-level/all-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -24191,6 +24191,10 @@ in

wmctrl = callPackage ../tools/X11/wmctrl { };

wmderland = callPackage ../applications/window-managers/wmderland { };

wmderlandc = callPackage ../applications/window-managers/wmderlandc { };

wmii_hg = callPackage ../applications/window-managers/wmii-hg { };

wofi = callPackage ../applications/misc/wofi { };
Expand Down