From 354dcaa17844330c6574525140040d02635a8cf8 Mon Sep 17 00:00:00 2001 From: Lin Xianyi Date: Sat, 25 May 2024 11:58:31 +0800 Subject: [PATCH 01/12] hyprcursor: 0.1.8 -> 0.1.9 Diff: https://github.com/hyprwm/hyprcursor/compare/refs/tags/v0.1.8...v0.1.9 Changelog: https://github.com/hyprwm/hyprcursor/releases/tag/v0.1.9 (cherry picked from commit 2528dc85efa438f6b9dffb091d44f7fc6d9a6375) --- pkgs/by-name/hy/hyprcursor/package.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/by-name/hy/hyprcursor/package.nix b/pkgs/by-name/hy/hyprcursor/package.nix index eade6e69456bc..42885f20376f1 100644 --- a/pkgs/by-name/hy/hyprcursor/package.nix +++ b/pkgs/by-name/hy/hyprcursor/package.nix @@ -12,13 +12,13 @@ }: stdenv.mkDerivation (finalAttrs: { pname = "hyprcursor"; - version = "0.1.8"; + version = "0.1.9"; src = fetchFromGitHub { owner = "hyprwm"; repo = "hyprcursor"; rev = "refs/tags/v${finalAttrs.version}"; - hash = "sha256-zJboXgWNpNhKyNF8H/3UYzWkx7w00TOCGKi3cwi+tsw="; + hash = "sha256-FIN1wMoyePBTtibCbaeJaoKNLuAYIGwLCWAYC1DJanw="; }; patches = [ From 3a706857cf2adaf3c24f932360ff7e91ce4a0acd Mon Sep 17 00:00:00 2001 From: John Titor <50095635+JohnRTitor@users.noreply.github.com> Date: Wed, 12 Jun 2024 02:04:39 +0530 Subject: [PATCH 02/12] hyprwayland-scanner: 0.3.4 -> 0.3.10 Needed for Hyprland v41.0 release. (cherry picked from commit 83cc03fc76b66793b6c36175624a8cd2bc3a6ad8) --- pkgs/by-name/hy/hyprwayland-scanner/package.nix | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/pkgs/by-name/hy/hyprwayland-scanner/package.nix b/pkgs/by-name/hy/hyprwayland-scanner/package.nix index 7dc783d82ab8c..4db2e81f628e3 100644 --- a/pkgs/by-name/hy/hyprwayland-scanner/package.nix +++ b/pkgs/by-name/hy/hyprwayland-scanner/package.nix @@ -4,17 +4,18 @@ , cmake , pkg-config , pugixml +, nix-update-script , }: stdenv.mkDerivation (finalAttrs: { pname = "hyprwayland-scanner"; - version = "0.3.4"; + version = "0.3.10"; src = fetchFromGitHub { owner = "hyprwm"; repo = "hyprwayland-scanner"; rev = "v${finalAttrs.version}"; - hash = "sha256-D0pg+ZRwrt4lavZ97Ca8clsgbPA3duLj8iEM7riaIFY="; + hash = "sha256-YxmfxHfWed1fosaa7fC1u7XoKp1anEZU+7Lh/ojRKoM="; }; nativeBuildInputs = [ @@ -28,12 +29,15 @@ stdenv.mkDerivation (finalAttrs: { doCheck = true; - meta = with lib; { + passthru.updateScript = nix-update-script { }; + + meta = { homepage = "https://github.com/hyprwm/hyprwayland-scanner"; description = "A Hyprland version of wayland-scanner in and for C++"; - license = licenses.bsd3; - maintainers = with maintainers; [ fufexan ]; + changelog = "https://github.com/hyprwm/hyprwayland-scanner/releases/tag/${finalAttrs.version}"; + license = lib.licenses.bsd3; + maintainers = with lib.maintainers; [ fufexan ]; mainProgram = "hyprwayland-scanner"; - platforms = platforms.linux; + platforms = lib.platforms.linux; }; }) From 8124f292256e224f25b474430d3899faedb8317b Mon Sep 17 00:00:00 2001 From: John Titor <50095635+JohnRTitor@users.noreply.github.com> Date: Wed, 12 Jun 2024 10:17:22 +0530 Subject: [PATCH 03/12] hyprlandPlugins.hy3: 0.40.0 -> 0.41.0 (cherry picked from commit 9ad8ae35cef28df8419031271044f3ad4cd1f4b5) --- .../window-managers/hyprwm/hyprland/plugins.nix | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/pkgs/applications/window-managers/hyprwm/hyprland/plugins.nix b/pkgs/applications/window-managers/hyprwm/hyprland/plugins.nix index 413de25764114..859ddf6dcecc0 100644 --- a/pkgs/applications/window-managers/hyprwm/hyprland/plugins.nix +++ b/pkgs/applications/window-managers/hyprwm/hyprland/plugins.nix @@ -22,27 +22,27 @@ let plugins = { hy3 = { fetchFromGitHub, cmake, hyprland }: - mkHyprlandPlugin hyprland { + mkHyprlandPlugin hyprland rec { pluginName = "hy3"; - version = "0.40.0"; + version = "0.41.0"; src = fetchFromGitHub { owner = "outfoxxed"; repo = "hy3"; - rev = "hl0.40.0"; - hash = "sha256-Y9bIML3C5xyKKv+Yel4LUfSkScwGunOVZkg+Z1dPwHI="; + rev = "hl${version}"; + hash = "sha256-gEEWWlQRvejSR2RRg78Lubz6siIgknqj6CslveyyIP4="; }; nativeBuildInputs = [ cmake ]; dontStrip = true; - meta = with lib; { + meta = { homepage = "https://github.com/outfoxxed/hy3"; description = "Hyprland plugin for an i3 / sway like manual tiling layout"; - license = licenses.gpl3; - platforms = platforms.linux; - maintainers = [ maintainers.aacebedo ]; + license = lib.licenses.gpl3; + platforms = lib.platforms.linux; + maintainers = with lib.maintainers; [ aacebedo ]; }; }; }; From 8db20940081a3d4b0e117e24f497af739522d259 Mon Sep 17 00:00:00 2001 From: John Titor <50095635+JohnRTitor@users.noreply.github.com> Date: Fri, 14 Jun 2024 21:46:42 +0530 Subject: [PATCH 04/12] hyprutils: init at 0.1.2 needed for Hyprland 41.1 Co-authored-by: Donovan Glover (cherry picked from commit 0c723f647f806a870641256710ecce453d6437f3) --- pkgs/by-name/hy/hyprutils/package.nix | 35 +++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 pkgs/by-name/hy/hyprutils/package.nix diff --git a/pkgs/by-name/hy/hyprutils/package.nix b/pkgs/by-name/hy/hyprutils/package.nix new file mode 100644 index 0000000000000..f29cb3665fbda --- /dev/null +++ b/pkgs/by-name/hy/hyprutils/package.nix @@ -0,0 +1,35 @@ +{ + lib, + stdenv, + cmake, + fetchFromGitHub, +}: + +stdenv.mkDerivation (finalAttrs: { + pname = "hyprutils"; + version = "0.1.2"; + + src = fetchFromGitHub { + owner = "hyprwm"; + repo = "hyprutils"; + rev = "v${finalAttrs.version}"; + hash = "sha256-8KvVqtApNt4FWTdn1TqVvw00rpqyG9UuUPA2ilPVD1U="; + }; + + nativeBuildInputs = [ cmake ]; + + outputs = [ "out" "dev" ]; + + doCheck = false; + + meta = { + homepage = "https://github.com/hyprwm/hyprutils"; + description = "Small C++ library for utilities used across the Hypr* ecosystem"; + license = lib.licenses.bsd3; + platforms = lib.platforms.linux; + maintainers = with lib.maintainers; [ + donovanglover + johnrtitor + ]; + }; +}) From 7a3bf8f181795141c6e0e6b23ee400d02f0a1761 Mon Sep 17 00:00:00 2001 From: John Titor <50095635+JohnRTitor@users.noreply.github.com> Date: Fri, 14 Jun 2024 21:56:10 +0530 Subject: [PATCH 05/12] hyprland: move to pkgs/by-name, hyprlandPlugins: restructure (cherry picked from commit 2d88a5f17a118bbb3e4663196931b98df3321c81) --- .../{hyprland/plugins.nix => hyprland-plugins/default.nix} | 0 .../hyprland/default.nix => by-name/hy/hyprland/package.nix} | 0 pkgs/top-level/all-packages.nix | 4 +--- 3 files changed, 1 insertion(+), 3 deletions(-) rename pkgs/applications/window-managers/hyprwm/{hyprland/plugins.nix => hyprland-plugins/default.nix} (100%) rename pkgs/{applications/window-managers/hyprwm/hyprland/default.nix => by-name/hy/hyprland/package.nix} (100%) diff --git a/pkgs/applications/window-managers/hyprwm/hyprland/plugins.nix b/pkgs/applications/window-managers/hyprwm/hyprland-plugins/default.nix similarity index 100% rename from pkgs/applications/window-managers/hyprwm/hyprland/plugins.nix rename to pkgs/applications/window-managers/hyprwm/hyprland-plugins/default.nix diff --git a/pkgs/applications/window-managers/hyprwm/hyprland/default.nix b/pkgs/by-name/hy/hyprland/package.nix similarity index 100% rename from pkgs/applications/window-managers/hyprwm/hyprland/default.nix rename to pkgs/by-name/hy/hyprland/package.nix diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index c3db907dec9b4..3b79e2714718c 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -5509,8 +5509,6 @@ with pkgs; hypr = callPackage ../applications/window-managers/hyprwm/hypr { cairo = cairo.override { xcbSupport = true; }; }; - hyprland = callPackage ../applications/window-managers/hyprwm/hyprland { }; - hyprland-autoname-workspaces = callPackage ../applications/misc/hyprland-autoname-workspaces { }; hyprland-per-window-layout = callPackage ../tools/wayland/hyprland-per-window-layout { }; @@ -5525,7 +5523,7 @@ with pkgs; hyprshade = python311Packages.callPackage ../applications/window-managers/hyprwm/hyprshade { }; - hyprlandPlugins = recurseIntoAttrs (callPackage ../applications/window-managers/hyprwm/hyprland/plugins.nix { }); + hyprlandPlugins = recurseIntoAttrs (callPackage ../applications/window-managers/hyprwm/hyprland-plugins { }); hysteria = callPackage ../tools/networking/hysteria { }; From cdaf39cdb9919935a66ff941308f381edcc4e777 Mon Sep 17 00:00:00 2001 From: John Titor <50095635+JohnRTitor@users.noreply.github.com> Date: Fri, 14 Jun 2024 22:12:50 +0530 Subject: [PATCH 06/12] hyprland: add update script Co-authored-by: fufexan (cherry picked from commit 7b136032a56ca0bf1eac8d32bbf298a8dafdf976) --- pkgs/by-name/hy/hyprland/info.json | 7 ++++++ pkgs/by-name/hy/hyprland/package.nix | 16 ++++++++++--- pkgs/by-name/hy/hyprland/update.sh | 35 ++++++++++++++++++++++++++++ 3 files changed, 55 insertions(+), 3 deletions(-) create mode 100644 pkgs/by-name/hy/hyprland/info.json create mode 100644 pkgs/by-name/hy/hyprland/update.sh diff --git a/pkgs/by-name/hy/hyprland/info.json b/pkgs/by-name/hy/hyprland/info.json new file mode 100644 index 0000000000000..4f9a2cf5b829a --- /dev/null +++ b/pkgs/by-name/hy/hyprland/info.json @@ -0,0 +1,7 @@ +{ + "branch": "", + "commit_hash": "", + "commit_message": "", + "date": "", + "tag": "" +} diff --git a/pkgs/by-name/hy/hyprland/package.nix b/pkgs/by-name/hy/hyprland/package.nix index decfd5d3cd03f..bfd8b6b5b07ae 100644 --- a/pkgs/by-name/hy/hyprland/package.nix +++ b/pkgs/by-name/hy/hyprland/package.nix @@ -47,6 +47,9 @@ , hidpiXWayland ? false , enableNvidiaPatches ? false }: +let + info = builtins.fromJSON (builtins.readFile ./info.json); +in assert lib.assertMsg (!nvidiaPatches) "The option `nvidiaPatches` has been removed."; assert lib.assertMsg (!enableNvidiaPatches) "The option `enableNvidiaPatches` has been removed."; assert lib.assertMsg (!hidpiXWayland) "The option `hidpiXWayland` has been removed. Please refer https://wiki.hyprland.org/Configuring/XWayland"; @@ -68,9 +71,14 @@ stdenv.mkDerivation (finalAttrs: { sed -i "s#/usr#$out#" src/render/OpenGL.cpp ''; - # used by version.sh - DATE = "2024-05-05"; - HASH = finalAttrs.src.rev; + # variables used by generateVersion.sh script, and shown in `hyprctl version` + BRANCH = info.branch; + COMMITS = info.commit_hash; + DATE = info.date; + DIRTY = ""; + HASH = info.commit_hash; + MESSAGE = info.commit_message; + TAG = info.tag; depsBuildBuild = [ # to find wayland-scanner when cross-compiling @@ -152,6 +160,8 @@ stdenv.mkDerivation (finalAttrs: { passthru.providedSessions = [ "hyprland" ]; + passthru.updateScript = ./update.sh; + meta = with lib; { homepage = "https://github.com/hyprwm/Hyprland"; description = "A dynamic tiling Wayland compositor that doesn't sacrifice on its looks"; diff --git a/pkgs/by-name/hy/hyprland/update.sh b/pkgs/by-name/hy/hyprland/update.sh new file mode 100644 index 0000000000000..c729705f6b1d0 --- /dev/null +++ b/pkgs/by-name/hy/hyprland/update.sh @@ -0,0 +1,35 @@ +#!/usr/bin/env nix-shell +#! nix-shell -i bash -p common-updater-scripts fd jq + +set -eou pipefail + +latest_release="$(curl --silent 'https://api.github.com/repos/hyprwm/Hyprland/releases/latest')" +latest_tag="$(curl --silent 'https://api.github.com/repos/hyprwm/Hyprland/tags?per_page=1')" +commit_hash="$(jq -r '.[0].commit.sha' <<<"$latest_tag")" +latest_commit="$(curl --silent 'https://api.github.com/repos/hyprwm/Hyprland/commits/'"$commit_hash"'')" +commit_message="$(jq -r '.commit.message' <<<"$latest_commit")" + +tag=$(jq -r '.tag_name' <<<"$latest_release") +# drop 'v' prefix +version="${tag#v}" + +branch=$(jq -r '.target_commitish' <<<"$latest_release") + +date=$(jq -r '.created_at' <<<"$latest_release") +# truncate time +date=${date%T*} + +# update version; otherwise fail +update-source-version hyprland "$version" --ignore-same-hash + +# find hyprland dir +files="$(fd --full-path /hyprland/ | head -1)" +dir="${files%/*}" + +echo -e '{ + "branch": "'"$branch"'", + "commit_hash": "'"$commit_hash"'", + "commit_message": "'"$commit_message"'", + "date": "'"$date"'", + "tag": "'"$tag"'" +}' >"$dir/info.json" From f70a62aa6451306b13c12991a39a83ceb8f18ebd Mon Sep 17 00:00:00 2001 From: John Titor <50095635+JohnRTitor@users.noreply.github.com> Date: Fri, 14 Jun 2024 22:29:06 +0530 Subject: [PATCH 07/12] hyprland: 0.40.0-unstable-2024-05-05 -> 0.41.1 (cherry picked from commit 0c7a9deaddaec0758aa8177fe1b5a1b187c5ffa4) --- pkgs/by-name/hy/hyprland/info.json | 10 ++++---- pkgs/by-name/hy/hyprland/package.nix | 36 ++++++++++++++++++++++------ pkgs/by-name/hy/hyprland/update.sh | 0 3 files changed, 34 insertions(+), 12 deletions(-) mode change 100644 => 100755 pkgs/by-name/hy/hyprland/update.sh diff --git a/pkgs/by-name/hy/hyprland/info.json b/pkgs/by-name/hy/hyprland/info.json index 4f9a2cf5b829a..ef4aabbe6b03a 100644 --- a/pkgs/by-name/hy/hyprland/info.json +++ b/pkgs/by-name/hy/hyprland/info.json @@ -1,7 +1,7 @@ { - "branch": "", - "commit_hash": "", - "commit_message": "", - "date": "", - "tag": "" + "branch": "main", + "commit_hash": "9e781040d9067c2711ec2e9f5b47b76ef70762b3", + "commit_message": "props: bump version to 0.41.1", + "date": "2024-06-13", + "tag": "v0.41.1" } diff --git a/pkgs/by-name/hy/hyprland/package.nix b/pkgs/by-name/hy/hyprland/package.nix index bfd8b6b5b07ae..ff19b154df66a 100644 --- a/pkgs/by-name/hy/hyprland/package.nix +++ b/pkgs/by-name/hy/hyprland/package.nix @@ -9,21 +9,29 @@ , binutils , cairo , epoll-shim +, expat +, fribidi , git , hyprcursor , hyprland-protocols , hyprlang +, hyprutils , hyprwayland-scanner , jq , libGL , libdrm +, libdatrie , libexecinfo , libinput +, libselinux +, libsepol +, libthai , libuuid , libxkbcommon , mesa , pango , pciutils +, pcre2 , pkgconf , python3 , systemd @@ -56,19 +64,22 @@ assert lib.assertMsg (!hidpiXWayland) "The option `hidpiXWayland` has been remov stdenv.mkDerivation (finalAttrs: { pname = "hyprland" + lib.optionalString debug "-debug"; - version = "0.40.0-unstable-2024-05-05"; + version = "0.41.1"; src = fetchFromGitHub { owner = "hyprwm"; repo = finalAttrs.pname; fetchSubmodules = true; - rev = "f15513309b24790099d42974274eb23f66f7c985"; - hash = "sha256-zKOfgXPTlRqCR+EME4qjN9rgAnC3viI5KWx10dhKszw="; + rev = "refs/tags/v${finalAttrs.version}"; + hash = "sha256-hLnnNBWP1Qjs1I3fndMgp8rbWJruxdnGTq77A4Rv4R4="; }; postPatch = '' # Fix hardcoded paths to /usr installation sed -i "s#/usr#$out#" src/render/OpenGL.cpp + + # Remove extra @PREFIX@ to fix pkg-config paths + sed -i "s#@PREFIX@/##g" hyprland.pc.in ''; # variables used by generateVersion.sh script, and shown in `hyprctl version` @@ -106,13 +117,20 @@ stdenv.mkDerivation (finalAttrs: { buildInputs = [ cairo + expat + fribidi git - hyprcursor + hyprcursor.dev hyprland-protocols hyprlang + hyprutils libGL + libdatrie libdrm libinput + libselinux + libsepol + libthai libuuid libxkbcommon mesa @@ -120,6 +138,7 @@ stdenv.mkDerivation (finalAttrs: { wayland-protocols pango pciutils + pcre2 tomlplusplus # for subproject wlroots-hyprland seatd @@ -162,11 +181,14 @@ stdenv.mkDerivation (finalAttrs: { passthru.updateScript = ./update.sh; - meta = with lib; { + meta = { homepage = "https://github.com/hyprwm/Hyprland"; description = "A dynamic tiling Wayland compositor that doesn't sacrifice on its looks"; - license = licenses.bsd3; - maintainers = with maintainers; [ wozeparrot fufexan ]; + license = lib.licenses.bsd3; + maintainers = with lib.maintainers; [ + wozeparrot + fufexan + ]; mainProgram = "Hyprland"; platforms = lib.platforms.linux; }; diff --git a/pkgs/by-name/hy/hyprland/update.sh b/pkgs/by-name/hy/hyprland/update.sh old mode 100644 new mode 100755 From 6bd3a0272ac49ea878cdee2514170c417f3e3068 Mon Sep 17 00:00:00 2001 From: John Titor <50095635+JohnRTitor@users.noreply.github.com> Date: Wed, 19 Jun 2024 21:24:54 +0530 Subject: [PATCH 08/12] hyprutils: 0.1.2 -> 0.1.4 (cherry picked from commit dda39b703d8760ddf05a10031ea3d246d406127b) --- pkgs/by-name/hy/hyprutils/package.nix | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/pkgs/by-name/hy/hyprutils/package.nix b/pkgs/by-name/hy/hyprutils/package.nix index f29cb3665fbda..1ad3a925ff323 100644 --- a/pkgs/by-name/hy/hyprutils/package.nix +++ b/pkgs/by-name/hy/hyprutils/package.nix @@ -2,25 +2,34 @@ lib, stdenv, cmake, + pkg-config, + pixman, fetchFromGitHub, }: stdenv.mkDerivation (finalAttrs: { pname = "hyprutils"; - version = "0.1.2"; + version = "0.1.4"; src = fetchFromGitHub { owner = "hyprwm"; repo = "hyprutils"; - rev = "v${finalAttrs.version}"; - hash = "sha256-8KvVqtApNt4FWTdn1TqVvw00rpqyG9UuUPA2ilPVD1U="; + rev = "refs/tags/v${finalAttrs.version}"; + hash = "sha256-CqRZne63BpYlPd/i8lXV0UInUt59oKogiwdVtBRHt60="; }; - nativeBuildInputs = [ cmake ]; + nativeBuildInputs = [ + cmake + pkg-config + ]; - outputs = [ "out" "dev" ]; + buildInputs = [ + pixman + ]; - doCheck = false; + outputs = ["out" "dev"]; + + cmakeBuildType = "RelWithDebInfo"; meta = { homepage = "https://github.com/hyprwm/hyprutils"; From 0b5734f0e269667f42f6db3dd7ef1333d9773897 Mon Sep 17 00:00:00 2001 From: Mihai Fufezan Date: Sun, 5 May 2024 15:05:25 +0300 Subject: [PATCH 09/12] hyprpaper: 0.6.0 -> 0.7.0 (cherry picked from commit 470a55471207f9de70893f2ef788f11fee607053) --- .../hyprwm/hyprpaper/default.nix | 40 +++++++++++-------- 1 file changed, 24 insertions(+), 16 deletions(-) diff --git a/pkgs/applications/window-managers/hyprwm/hyprpaper/default.nix b/pkgs/applications/window-managers/hyprwm/hyprpaper/default.nix index 85ef07039a430..fca98486e4de2 100644 --- a/pkgs/applications/window-managers/hyprwm/hyprpaper/default.nix +++ b/pkgs/applications/window-managers/hyprwm/hyprpaper/default.nix @@ -2,14 +2,24 @@ , stdenv , fetchFromGitHub , cmake +, cairo +, expat , file +, fribidi , hyprlang +, libdatrie , libGL , libjpeg +, libselinux +, libsepol +, libthai , libwebp -, mesa +, libXdmcp , pango +, pcre +, pcre2 , pkg-config +, util-linux , wayland , wayland-protocols , wayland-scanner @@ -17,13 +27,13 @@ stdenv.mkDerivation (finalAttrs: { pname = "hyprpaper"; - version = "0.6.0"; + version = "0.7.0"; src = fetchFromGitHub { owner = "hyprwm"; repo = finalAttrs.pname; rev = "v${finalAttrs.version}"; - hash = "sha256-mqxnaNiCVJS88Dk4V1v2wdS0RaCbOk8HFOUUbp0Uiy0="; + hash = "sha256-l13c8ALA7ZKDgluYA1C1OfkDGYD6e1/GR6LJnxCLRhA="; }; nativeBuildInputs = [ @@ -33,13 +43,23 @@ stdenv.mkDerivation (finalAttrs: { ]; buildInputs = [ + cairo + expat file + fribidi hyprlang + libdatrie libGL libjpeg + libselinux + libsepol + libthai libwebp - mesa + libXdmcp pango + pcre + pcre2 + util-linux wayland wayland-protocols ]; @@ -49,18 +69,6 @@ stdenv.mkDerivation (finalAttrs: { --replace GIT_COMMIT_HASH '"${finalAttrs.src.rev}"' ''; - preConfigure = '' - make protocols - ''; - - installPhase = '' - runHook preInstall - - install -Dm755 ./hyprpaper -t $out/bin - - runHook postInstall - ''; - meta = with lib; { inherit (finalAttrs.src.meta) homepage; description = "A blazing fast wayland wallpaper utility"; From eb5f40db880a73c6832e98c19219e1fb67674cbc Mon Sep 17 00:00:00 2001 From: Mihai Fufezan Date: Fri, 21 Jun 2024 21:48:36 +0300 Subject: [PATCH 10/12] hyprlandPlugins.hy3: move to separate file Format with nixfmt-rfc-style. (cherry picked from commit 8e6784a241cb784bab30abbc387232b082db926b) --- .../hyprwm/hyprland-plugins/default.nix | 70 +++++++------------ .../hyprwm/hyprland-plugins/hy3.nix | 30 ++++++++ 2 files changed, 57 insertions(+), 43 deletions(-) create mode 100644 pkgs/applications/window-managers/hyprwm/hyprland-plugins/hy3.nix diff --git a/pkgs/applications/window-managers/hyprwm/hyprland-plugins/default.nix b/pkgs/applications/window-managers/hyprwm/hyprland-plugins/default.nix index 859ddf6dcecc0..b5cf42a8148ac 100644 --- a/pkgs/applications/window-managers/hyprwm/hyprland-plugins/default.nix +++ b/pkgs/applications/window-managers/hyprwm/hyprland-plugins/default.nix @@ -1,50 +1,34 @@ -{ lib -, callPackage -, pkg-config -, stdenv -, hyprland +{ + lib, + callPackage, + pkg-config, + stdenv, + hyprland, }: let - mkHyprlandPlugin = hyprland: + mkHyprlandPlugin = + hyprland: args@{ pluginName, ... }: - stdenv.mkDerivation (args // { - pname = "${pluginName}"; - nativeBuildInputs = [ pkg-config ] ++ args.nativeBuildInputs or [ ]; - buildInputs = [ hyprland ] - ++ hyprland.buildInputs - ++ (args.buildInputs or [ ]); - meta = args.meta // { - description = args.meta.description or ""; - longDescription = (args.meta.longDescription or "") + - "\n\nPlugins can be installed via a plugin entry in the Hyprland NixOS or Home Manager options."; - }; - }); - - plugins = { - hy3 = { fetchFromGitHub, cmake, hyprland }: - mkHyprlandPlugin hyprland rec { - pluginName = "hy3"; - version = "0.41.0"; - - src = fetchFromGitHub { - owner = "outfoxxed"; - repo = "hy3"; - rev = "hl${version}"; - hash = "sha256-gEEWWlQRvejSR2RRg78Lubz6siIgknqj6CslveyyIP4="; + stdenv.mkDerivation ( + args + // { + pname = "${pluginName}"; + nativeBuildInputs = [ pkg-config ] ++ args.nativeBuildInputs or [ ]; + buildInputs = [ hyprland ] ++ hyprland.buildInputs ++ (args.buildInputs or [ ]); + meta = args.meta // { + description = args.meta.description or ""; + longDescription = + (args.meta.longDescription or "") + + "\n\nPlugins can be installed via a plugin entry in the Hyprland NixOS or Home Manager options."; }; + } + ); - nativeBuildInputs = [ cmake ]; - - dontStrip = true; - - meta = { - homepage = "https://github.com/outfoxxed/hy3"; - description = "Hyprland plugin for an i3 / sway like manual tiling layout"; - license = lib.licenses.gpl3; - platforms = lib.platforms.linux; - maintainers = with lib.maintainers; [ aacebedo ]; - }; - }; + plugins = { + hy3 = import ./hy3.nix; }; in -(lib.mapAttrs (name: plugin: callPackage plugin { }) plugins) // { inherit mkHyprlandPlugin; } +(lib.mapAttrs (name: plugin: callPackage plugin { inherit mkHyprlandPlugin; }) plugins) +// { + inherit mkHyprlandPlugin; +} diff --git a/pkgs/applications/window-managers/hyprwm/hyprland-plugins/hy3.nix b/pkgs/applications/window-managers/hyprwm/hyprland-plugins/hy3.nix new file mode 100644 index 0000000000000..88bf78b6f6672 --- /dev/null +++ b/pkgs/applications/window-managers/hyprwm/hyprland-plugins/hy3.nix @@ -0,0 +1,30 @@ +{ + lib, + cmake, + fetchFromGitHub, + hyprland, + mkHyprlandPlugin, +}: +mkHyprlandPlugin hyprland rec { + pluginName = "hy3"; + version = "0.41.0"; + + src = fetchFromGitHub { + owner = "outfoxxed"; + repo = "hy3"; + rev = "hl${version}"; + hash = "sha256-gEEWWlQRvejSR2RRg78Lubz6siIgknqj6CslveyyIP4="; + }; + + nativeBuildInputs = [ cmake ]; + + dontStrip = true; + + meta = { + homepage = "https://github.com/outfoxxed/hy3"; + description = "Hyprland plugin for an i3 / sway like manual tiling layout"; + license = lib.licenses.gpl3; + platforms = lib.platforms.linux; + maintainers = with lib.maintainers; [ aacebedo ]; + }; +} From 1874445e9c4441ab67b64e9da81d7eeae1fa9220 Mon Sep 17 00:00:00 2001 From: Mihai Fufezan Date: Sat, 22 Jun 2024 20:59:56 +0300 Subject: [PATCH 11/12] hyprlandPlugins.hy3: 0.41.0 -> 0.41.1 (cherry picked from commit ef64bb49153eb638d2bc16b9c5ec4fff7940a0e4) --- .../window-managers/hyprwm/hyprland-plugins/hy3.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/applications/window-managers/hyprwm/hyprland-plugins/hy3.nix b/pkgs/applications/window-managers/hyprwm/hyprland-plugins/hy3.nix index 88bf78b6f6672..acb4aa2d322c0 100644 --- a/pkgs/applications/window-managers/hyprwm/hyprland-plugins/hy3.nix +++ b/pkgs/applications/window-managers/hyprwm/hyprland-plugins/hy3.nix @@ -7,13 +7,13 @@ }: mkHyprlandPlugin hyprland rec { pluginName = "hy3"; - version = "0.41.0"; + version = "0.41.1"; src = fetchFromGitHub { owner = "outfoxxed"; repo = "hy3"; rev = "hl${version}"; - hash = "sha256-gEEWWlQRvejSR2RRg78Lubz6siIgknqj6CslveyyIP4="; + hash = "sha256-bRLI+zgfT31LCMW4Pf701ZZx2oFeXoBu1BfYQjX6MPc="; }; nativeBuildInputs = [ cmake ]; From 7d10d88146d7bfa0ec254ce794f966cbc1e53ad8 Mon Sep 17 00:00:00 2001 From: Mihai Fufezan Date: Fri, 21 Jun 2024 22:08:44 +0300 Subject: [PATCH 12/12] hyprlandPlugins: init upstream hyprland-plugins at 0.41.1 (cherry picked from commit cf7b89e9a6705d6c7c920d7a16cf758092d85202) --- .../hyprwm/hyprland-plugins/default.nix | 7 +-- .../hyprland-plugins/hyprland-plugins.nix | 51 +++++++++++++++++++ 2 files changed, 55 insertions(+), 3 deletions(-) create mode 100644 pkgs/applications/window-managers/hyprwm/hyprland-plugins/hyprland-plugins.nix diff --git a/pkgs/applications/window-managers/hyprwm/hyprland-plugins/default.nix b/pkgs/applications/window-managers/hyprwm/hyprland-plugins/default.nix index b5cf42a8148ac..f994b19175209 100644 --- a/pkgs/applications/window-managers/hyprwm/hyprland-plugins/default.nix +++ b/pkgs/applications/window-managers/hyprwm/hyprland-plugins/default.nix @@ -24,9 +24,10 @@ let } ); - plugins = { - hy3 = import ./hy3.nix; - }; + plugins = lib.mergeAttrsList [ + { hy3 = import ./hy3.nix; } + (import ./hyprland-plugins.nix) + ]; in (lib.mapAttrs (name: plugin: callPackage plugin { inherit mkHyprlandPlugin; }) plugins) // { diff --git a/pkgs/applications/window-managers/hyprwm/hyprland-plugins/hyprland-plugins.nix b/pkgs/applications/window-managers/hyprwm/hyprland-plugins/hyprland-plugins.nix new file mode 100644 index 0000000000000..8ae5348e997c4 --- /dev/null +++ b/pkgs/applications/window-managers/hyprwm/hyprland-plugins/hyprland-plugins.nix @@ -0,0 +1,51 @@ +let + # shared src for upstream hyprland-plugins repo + # function generating derivations for all plugins in hyprland-plugins + hyprland-plugins = + builtins.mapAttrs + ( + name: description: + ( + { + lib, + cmake, + fetchFromGitHub, + hyprland, + mkHyprlandPlugin, + }: + let + version = "0.41.1"; + + hyprland-plugins-src = fetchFromGitHub { + owner = "hyprwm"; + repo = "hyprland-plugins"; + rev = "v${version}"; + hash = "sha256-Bw3JRBUZg2kmDwxa/UHvD//gGcNjbftTj2MSeLvx1q8="; + }; + in + mkHyprlandPlugin hyprland { + pluginName = name; + inherit version; + + src = "${hyprland-plugins-src}/${name}"; + nativeBuildInputs = [ cmake ]; + meta = { + homepage = "https://github.com/hyprwm/hyprland-plugins"; + description = "Hyprland ${description} plugin"; + license = lib.licenses.bsd3; + maintainers = with lib.maintainers; [ fufexan ]; + platforms = lib.platforms.linux; + }; + } + ) + ) + { + borders-plus-plus = "multiple borders"; + csgo-vulkan-fix = "CS:GO/CS2 Vulkan fix"; + hyprbars = "window title"; + hyprexpo = "workspaces overview"; + hyprtrails = "smooth trails behind moving windows"; + hyprwinwrap = "xwinwrap-like"; + }; +in +hyprland-plugins