49 , enableXWayland ? true
50 , legacyRenderer ? false
51 , withSystemd ? lib.meta.availableOn stdenv.hostPlatform systemd
52 , wrapRuntimeDeps ? true
54 , nvidiaPatches ? false
55 , hidpiXWayland ? false
56 , enableNvidiaPatches ? false
59 info = builtins.fromJSON (builtins.readFile ./info.json);
61 assert lib.assertMsg (!nvidiaPatches) "The option `nvidiaPatches` has been removed.";
62 assert lib.assertMsg (!enableNvidiaPatches) "The option `enableNvidiaPatches` has been removed.";
63 assert lib.assertMsg (!hidpiXWayland) "The option `hidpiXWayland` has been removed. Please refer https://wiki.hyprland.org/Configuring/XWayland";
65 stdenv.mkDerivation (finalAttrs: {
66 pname = "hyprland" + lib.optionalString debug "-debug";
69 src = fetchFromGitHub {
72 fetchSubmodules = true;
73 rev = "refs/tags/v${finalAttrs.version}";
74 hash = "sha256-JmfnYz+9a4TjNl3mAus1VpoWtTI9d1xkW9MHbkcV0Po=";
78 # Fix hardcoded paths to /usr installation
79 sed -i "s#/usr#$out#" src/render/OpenGL.cpp
81 # Remove extra @PREFIX@ to fix pkg-config paths
82 sed -i "s#@PREFIX@/##g" hyprland.pc.in
85 # variables used by generateVersion.sh script, and shown in `hyprctl version`
87 COMMITS = info.commit_hash;
90 HASH = info.commit_hash;
91 MESSAGE = info.commit_message;
95 # to find wayland-scanner when cross-compiling
143 # for subproject wlroots-hyprland
148 xorg.xcbutilrenderutil
150 ++ lib.optionals stdenv.hostPlatform.isBSD [ epoll-shim ]
151 ++ lib.optionals stdenv.hostPlatform.isMusl [ libexecinfo ]
152 ++ lib.optionals enableXWayland [
159 ++ lib.optionals withSystemd [ systemd ];
164 else "RelWithDebInfo";
168 (lib.cmakeBool "NO_XWAYLAND" (!enableXWayland))
169 (lib.cmakeBool "LEGACY_RENDERER" legacyRenderer)
170 (lib.cmakeBool "NO_SYSTEMD" (!withSystemd))
174 ${lib.optionalString wrapRuntimeDeps ''
175 wrapProgram $out/bin/Hyprland \
176 --suffix PATH : ${lib.makeBinPath [binutils pciutils pkgconf]}
180 passthru.providedSessions = [ "hyprland" ];
182 passthru.updateScript = ./update.sh;
185 homepage = "https://github.com/hyprwm/Hyprland";
186 description = "Dynamic tiling Wayland compositor that doesn't sacrifice on its looks";
187 license = lib.licenses.bsd3;
188 maintainers = with lib.maintainers; [
193 mainProgram = "Hyprland";
194 platforms = lib.platforms.linux;