From 57e277704b821e74bbd238f287e5bbba99818a77 Mon Sep 17 00:00:00 2001 From: John Titor <50095635+JohnRTitor@users.noreply.github.com> Date: Sat, 27 Jul 2024 11:22:17 +0530 Subject: [PATCH 1/4] uwsm: add kai-tub to maintainers https://github.com/NixOS/nixpkgs/pull/330245#issuecomment-2253528614 --- pkgs/by-name/uw/uwsm/package.nix | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pkgs/by-name/uw/uwsm/package.nix b/pkgs/by-name/uw/uwsm/package.nix index 669cbd123a5a..0ce4b0bcd08f 100644 --- a/pkgs/by-name/uw/uwsm/package.nix +++ b/pkgs/by-name/uw/uwsm/package.nix @@ -65,7 +65,10 @@ stdenv.mkDerivation (finalAttrs: { description = "Universal wayland session manager"; homepage = "https://github.com/Vladimir-csp/uwsm"; license = lib.licenses.mit; - maintainers = with lib.maintainers; [ johnrtitor ]; + maintainers = with lib.maintainers; [ + johnrtitor + kai-tub + ]; platforms = lib.platforms.linux; }; }) From 276441cced99b310b37f2a769727dfea06d6428b Mon Sep 17 00:00:00 2001 From: John Titor <50095635+JohnRTitor@users.noreply.github.com> Date: Sat, 27 Jul 2024 00:38:57 +0530 Subject: [PATCH 2/4] uwsm: 0.17.0 -> 0.17.2 Co-authored-by: Kai Norman Clasen --- pkgs/by-name/uw/uwsm/package.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/by-name/uw/uwsm/package.nix b/pkgs/by-name/uw/uwsm/package.nix index 0ce4b0bcd08f..0fafbd458d3c 100644 --- a/pkgs/by-name/uw/uwsm/package.nix +++ b/pkgs/by-name/uw/uwsm/package.nix @@ -24,13 +24,13 @@ let in stdenv.mkDerivation (finalAttrs: { pname = "uwsm"; - version = "0.17.0"; + version = "0.17.2"; src = fetchFromGitHub { owner = "Vladimir-csp"; repo = "uwsm"; rev = "refs/tags/v${finalAttrs.version}"; - hash = "sha256-M2j7l5XTSS2IzaJofAHct1tuAO2A9Ps9mCgAWKEvzoE="; + hash = "sha256-7RPz0VOUJ4fFhxNq+/s+/YEvy03XXgssggPn/JtOZI4="; }; nativeBuildInputs = [ From 6317528b1a8830e4ac79462dc55636f08c514fa9 Mon Sep 17 00:00:00 2001 From: John Titor <50095635+JohnRTitor@users.noreply.github.com> Date: Sat, 27 Jul 2024 00:41:31 +0530 Subject: [PATCH 3/4] uwsm: fix dependencies add wrap the binary as well add mainProgram Co-authored-by: Kai Norman Clasen --- pkgs/by-name/uw/uwsm/package.nix | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/pkgs/by-name/uw/uwsm/package.nix b/pkgs/by-name/uw/uwsm/package.nix index 0fafbd458d3c..4d7eb5cc34be 100644 --- a/pkgs/by-name/uw/uwsm/package.nix +++ b/pkgs/by-name/uw/uwsm/package.nix @@ -2,13 +2,16 @@ stdenv, lib, fetchFromGitHub, + makeBinaryWrapper, meson, ninja, scdoc, pkg-config, nix-update-script, + bash, dmenu, libnotify, + newt, python3Packages, util-linux, fumonSupport ? true, @@ -34,19 +37,21 @@ stdenv.mkDerivation (finalAttrs: { }; nativeBuildInputs = [ + makeBinaryWrapper meson ninja pkg-config scdoc ]; - buildInputs = [ - libnotify - util-linux + propagatedBuildInputs = [ + util-linux # waitpid + newt # whiptail + libnotify # notify + bash # sh + python ] ++ (lib.optionals uuctlSupport [ dmenu ]); - propagatedBuildInputs = [ python ]; - mesonFlags = [ "--prefix=${placeholder "out"}" (lib.mapAttrsToList lib.mesonEnable { @@ -61,9 +66,19 @@ stdenv.mkDerivation (finalAttrs: { updateScript = nix-update-script { }; }; + postInstall = '' + wrapProgram $out/bin/uwsm \ + --prefix PATH : ${lib.makeBinPath finalAttrs.propagatedBuildInputs} + ${lib.optionalString uuctlSupport '' + wrapProgram $out/bin/uuctl \ + --prefix PATH : ${lib.makeBinPath finalAttrs.propagatedBuildInputs} + ''} + ''; + meta = { description = "Universal wayland session manager"; homepage = "https://github.com/Vladimir-csp/uwsm"; + mainProgram = "uwsm"; license = lib.licenses.mit; maintainers = with lib.maintainers; [ johnrtitor From 2c60d67129917da73d08a279958f1829288c8f71 Mon Sep 17 00:00:00 2001 From: John Titor <50095635+JohnRTitor@users.noreply.github.com> Date: Mon, 29 Jul 2024 19:06:20 +0530 Subject: [PATCH 4/4] uwsm: also wrap sway and hyprland's paths Remove this when it's not needed anymore --- pkgs/by-name/uw/uwsm/package.nix | 37 +++++++++++++++++++++++++------- 1 file changed, 29 insertions(+), 8 deletions(-) diff --git a/pkgs/by-name/uw/uwsm/package.nix b/pkgs/by-name/uw/uwsm/package.nix index 4d7eb5cc34be..2ec573bbe545 100644 --- a/pkgs/by-name/uw/uwsm/package.nix +++ b/pkgs/by-name/uw/uwsm/package.nix @@ -14,9 +14,13 @@ newt, python3Packages, util-linux, + hyprland, + sway, fumonSupport ? true, uuctlSupport ? true, uwsmAppSupport ? true, + hyprlandSupport ? false, + swaySupport ? false, }: let python = python3Packages.python.withPackages (ps: [ @@ -66,14 +70,31 @@ stdenv.mkDerivation (finalAttrs: { updateScript = nix-update-script { }; }; - postInstall = '' - wrapProgram $out/bin/uwsm \ - --prefix PATH : ${lib.makeBinPath finalAttrs.propagatedBuildInputs} - ${lib.optionalString uuctlSupport '' - wrapProgram $out/bin/uuctl \ - --prefix PATH : ${lib.makeBinPath finalAttrs.propagatedBuildInputs} - ''} - ''; + postInstall = + let + wrapperArgs = '' + --prefix PATH : "${lib.makeBinPath finalAttrs.propagatedBuildInputs}" \ + --suffix PATH : "${ + lib.makeBinPath ( + # uwsm as of 0.17.2 can load WMs like sway and hyprland by path + # but this is still needed as a fallback + lib.optionals hyprlandSupport [ hyprland ] ++ lib.optionals swaySupport [ sway ] + ) + }" + ''; + in + '' + wrapProgram $out/bin/uwsm ${wrapperArgs} + ${lib.optionalString uuctlSupport '' + wrapProgram $out/bin/uuctl ${wrapperArgs} + ''} + ${lib.optionalString uwsmAppSupport '' + wrapProgram $out/bin/uwsm-app ${wrapperArgs} + ''} + ${lib.optionalString fumonSupport '' + wrapProgram $out/bin/fumon ${wrapperArgs} + ''} + ''; meta = { description = "Universal wayland session manager";