From 0a0b350b3ab2b8a8fe70d8791ba56036f79f5dd5 Mon Sep 17 00:00:00 2001 From: EdenQwQ Date: Wed, 26 Mar 2025 22:30:55 +0800 Subject: [PATCH] add hellwm --- flake.lock | 19 ++++---- flake.nix | 4 +- home/programs/desktop/niri/swhkd.nix | 4 ++ os/programs/default.nix | 1 + os/programs/hellwm.nix | 5 +++ os/programs/maomaowm.nix | 1 - pkgs/default.nix | 1 + pkgs/hellwm.nix | 67 ++++++++++++++++++++++++++++ 8 files changed, 89 insertions(+), 13 deletions(-) create mode 100644 os/programs/hellwm.nix create mode 100644 pkgs/hellwm.nix diff --git a/flake.lock b/flake.lock index f3b7cfc..5819162 100644 --- a/flake.lock +++ b/flake.lock @@ -582,18 +582,17 @@ "treefmt-nix": "treefmt-nix" }, "locked": { - "lastModified": 1742914369, - "narHash": "sha256-WQIjFPUxSsiEZccN5lVWT/p1/d99iPmnJ4yd/oTCnkY=", - "owner": "DreamMaoMao", - "repo": "maomaowm", - "rev": "86d4b2d9d0755a2b5b79d244e43cf7c9f81ab138", - "type": "github" + "lastModified": 1742919954, + "narHash": "sha256-uog87uhRIOmJAaWbF+cP3x8TGX4uSqPYncPjKo5YA5U=", + "ref": "refs/heads/wlroots-0.19", + "rev": "ed7e8bf93afc3d428a93501de53d581a8eb53218", + "revCount": 228, + "type": "git", + "url": "file:///home/eden/Repos/maomaowm-test" }, "original": { - "owner": "DreamMaoMao", - "ref": "wlroots-0.19", - "repo": "maomaowm", - "type": "github" + "type": "git", + "url": "file:///home/eden/Repos/maomaowm-test" } }, "mmsg": { diff --git a/flake.nix b/flake.nix index 9477e17..c3588b9 100644 --- a/flake.nix +++ b/flake.nix @@ -74,7 +74,7 @@ nh.url = "github:viperML/nh"; treefmt-nix.url = "github:numtide/treefmt-nix"; agenix.url = "github:ryantm/agenix"; - maomaowm.url = "github:DreamMaoMao/maomaowm/wlroots-0.19"; - # maomaowm.url = "git+file:///home/eden/Repos/maomaowm-orig"; + # maomaowm.url = "github:EdenQwQ/maomaowm/wlroots-0.19"; + maomaowm.url = "git+file:///home/eden/Repos/maomaowm-test"; }; } diff --git a/home/programs/desktop/niri/swhkd.nix b/home/programs/desktop/niri/swhkd.nix index 11a6709..324372d 100644 --- a/home/programs/desktop/niri/swhkd.nix +++ b/home/programs/desktop/niri/swhkd.nix @@ -43,6 +43,10 @@ in (niriAction "super + {_, shift +} {minus, equal}" "set-{column\\-width, window\\-height} \"{\\-, +}10%\"") (niriAction "{ctrl +, alt +} print" "screenshot-{screen, window}") (niriAction "print" "screenshot") + { + key = "super + ctrl + c"; + command = "niri msg pick-color | grep Hex | sd 'Hex: ' '' | sd '\\n' '' | wl-copy"; + } ]; }; } diff --git a/os/programs/default.nix b/os/programs/default.nix index fe6b55f..1cb664d 100644 --- a/os/programs/default.nix +++ b/os/programs/default.nix @@ -6,5 +6,6 @@ ./ai.nix ./swhkd.nix ./maomaowm.nix + ./hellwm.nix ]; } diff --git a/os/programs/hellwm.nix b/os/programs/hellwm.nix new file mode 100644 index 0000000..42fd259 --- /dev/null +++ b/os/programs/hellwm.nix @@ -0,0 +1,5 @@ +{ pkgs, ... }: +{ + environment.systemPackages = [ pkgs.hellwm ]; + services.displayManager.sessionPackages = [ pkgs.hellwm ]; +} diff --git a/os/programs/maomaowm.nix b/os/programs/maomaowm.nix index fd35ced..a7f9e11 100644 --- a/os/programs/maomaowm.nix +++ b/os/programs/maomaowm.nix @@ -1,6 +1,5 @@ { programs = { maomaowm.enable = true; - maomaowm.mmsg.enable = true; }; } diff --git a/pkgs/default.nix b/pkgs/default.nix index f86789a..daa2e37 100644 --- a/pkgs/default.nix +++ b/pkgs/default.nix @@ -8,4 +8,5 @@ hugmetight-font = pkgs.callPackage ./fonts/hugmetight.nix { }; custom-colorschemes = pkgs.callPackage ./customColorSchemes { }; fiz = pkgs.callPackage ./fiz.nix { }; + hellwm = pkgs.callPackage ./hellwm.nix { }; } diff --git a/pkgs/hellwm.nix b/pkgs/hellwm.nix new file mode 100644 index 0000000..1f557cd --- /dev/null +++ b/pkgs/hellwm.nix @@ -0,0 +1,67 @@ +{ + stdenv, + lua, + libdrm, + pixman, + wayland, + libinput, + pkg-config, + wlroots_0_18, + libxkbcommon, + wayland-scanner, + wayland-protocols, + lib, + fetchFromGitHub, +}: +stdenv.mkDerivation { + pname = "hellwm"; + version = "0.0.1"; + + src = lib.cleanSource (fetchFromGitHub { + owner = "EdenQwQ"; + repo = "hellwm"; + rev = "c84f13f6167af6625038d7effcb7494d53cf1856"; + hash = "sha256-uFhU7s4rkSpEUQH5mSuCgbE/SNGVV0uTqnpPoS0AWi0="; + }); + + buildInputs = [ + lua + libdrm + pixman + wayland + libinput + pkg-config + wlroots_0_18 + libxkbcommon + wayland-scanner + wayland-protocols + ]; + + buildPhase = '' + make + ''; + + installPhase = '' + mkdir -p $out/bin + mkdir -p $out/share/wayland-sessions + install -Dm755 hellwm -t $out/bin + install -Dm755 hellcli -t $out/bin + cat > $out/share/wayland-sessions/hellwm.desktop << EOF + [Desktop Entry] + Name=HellWM + Comment=HellWM Wayland Compositor + Exec=$out/bin/hellwm + Type=Application + EOF + ''; + + passthru = { + providedSessions = [ "hellwm" ]; + }; + + meta = { + description = "HellWM"; + homepage = "https://github.com/HellSoftware/HellWM"; + maintainers = [ "danihek" ]; + }; +}