diff --git a/pkgs/applications/window-managers/hyprwm/hyprland-plugins/default.nix b/pkgs/applications/window-managers/hyprwm/hyprland-plugins/default.nix new file mode 100644 index 0000000000000..f994b19175209 --- /dev/null +++ b/pkgs/applications/window-managers/hyprwm/hyprland-plugins/default.nix @@ -0,0 +1,35 @@ +{ + lib, + callPackage, + pkg-config, + stdenv, + hyprland, +}: +let + 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 = lib.mergeAttrsList [ + { hy3 = import ./hy3.nix; } + (import ./hyprland-plugins.nix) + ]; +in +(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..acb4aa2d322c0 --- /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.1"; + + src = fetchFromGitHub { + owner = "outfoxxed"; + repo = "hy3"; + rev = "hl${version}"; + hash = "sha256-bRLI+zgfT31LCMW4Pf701ZZx2oFeXoBu1BfYQjX6MPc="; + }; + + 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 ]; + }; +} 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 diff --git a/pkgs/applications/window-managers/hyprwm/hyprland/plugins.nix b/pkgs/applications/window-managers/hyprwm/hyprland/plugins.nix deleted file mode 100644 index 413de25764114..0000000000000 --- a/pkgs/applications/window-managers/hyprwm/hyprland/plugins.nix +++ /dev/null @@ -1,50 +0,0 @@ -{ lib -, callPackage -, pkg-config -, stdenv -, hyprland -}: -let - 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 { - pluginName = "hy3"; - version = "0.40.0"; - - src = fetchFromGitHub { - owner = "outfoxxed"; - repo = "hy3"; - rev = "hl0.40.0"; - hash = "sha256-Y9bIML3C5xyKKv+Yel4LUfSkScwGunOVZkg+Z1dPwHI="; - }; - - nativeBuildInputs = [ cmake ]; - - dontStrip = true; - - meta = with lib; { - 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 ]; - }; - }; - }; -in -(lib.mapAttrs (name: plugin: callPackage plugin { }) plugins) // { inherit mkHyprlandPlugin; } 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"; 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 = [ diff --git a/pkgs/by-name/hy/hyprland/info.json b/pkgs/by-name/hy/hyprland/info.json new file mode 100644 index 0000000000000..ef4aabbe6b03a --- /dev/null +++ b/pkgs/by-name/hy/hyprland/info.json @@ -0,0 +1,7 @@ +{ + "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/applications/window-managers/hyprwm/hyprland/default.nix b/pkgs/by-name/hy/hyprland/package.nix similarity index 77% rename from pkgs/applications/window-managers/hyprwm/hyprland/default.nix rename to pkgs/by-name/hy/hyprland/package.nix index decfd5d3cd03f..ff19b154df66a 100644 --- a/pkgs/applications/window-managers/hyprwm/hyprland/default.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 @@ -47,30 +55,41 @@ , 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"; 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 ''; - # 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 @@ -98,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 @@ -112,6 +138,7 @@ stdenv.mkDerivation (finalAttrs: { wayland-protocols pango pciutils + pcre2 tomlplusplus # for subproject wlroots-hyprland seatd @@ -152,11 +179,16 @@ stdenv.mkDerivation (finalAttrs: { passthru.providedSessions = [ "hyprland" ]; - meta = with lib; { + passthru.updateScript = ./update.sh; + + 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 new file mode 100755 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" diff --git a/pkgs/by-name/hy/hyprutils/package.nix b/pkgs/by-name/hy/hyprutils/package.nix new file mode 100644 index 0000000000000..1ad3a925ff323 --- /dev/null +++ b/pkgs/by-name/hy/hyprutils/package.nix @@ -0,0 +1,44 @@ +{ + lib, + stdenv, + cmake, + pkg-config, + pixman, + fetchFromGitHub, +}: + +stdenv.mkDerivation (finalAttrs: { + pname = "hyprutils"; + version = "0.1.4"; + + src = fetchFromGitHub { + owner = "hyprwm"; + repo = "hyprutils"; + rev = "refs/tags/v${finalAttrs.version}"; + hash = "sha256-CqRZne63BpYlPd/i8lXV0UInUt59oKogiwdVtBRHt60="; + }; + + nativeBuildInputs = [ + cmake + pkg-config + ]; + + buildInputs = [ + pixman + ]; + + outputs = ["out" "dev"]; + + cmakeBuildType = "RelWithDebInfo"; + + 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 + ]; + }; +}) 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; }; }) 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 { };