2022-05-17 13:11:24 +02:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
stdenv,
|
|
|
|
pkg-config,
|
2022-06-16 12:42:31 +02:00
|
|
|
meson,
|
2022-05-17 13:11:24 +02:00
|
|
|
ninja,
|
2022-12-19 13:13:07 +01:00
|
|
|
cairo,
|
2022-07-29 12:21:19 +02:00
|
|
|
git,
|
2022-12-05 18:05:15 +01:00
|
|
|
hyprland-protocols,
|
2023-01-06 15:31:57 +01:00
|
|
|
jq,
|
2022-05-17 13:11:24 +02:00
|
|
|
libdrm,
|
|
|
|
libinput,
|
|
|
|
libxcb,
|
|
|
|
libxkbcommon,
|
|
|
|
mesa,
|
2023-03-20 17:22:34 +01:00
|
|
|
pango,
|
2022-11-11 13:35:28 +01:00
|
|
|
pciutils,
|
2023-01-05 20:17:55 +01:00
|
|
|
systemd,
|
2023-02-27 13:32:38 +01:00
|
|
|
udis86,
|
2022-05-17 13:11:24 +02:00
|
|
|
wayland,
|
|
|
|
wayland-protocols,
|
|
|
|
wayland-scanner,
|
|
|
|
wlroots,
|
|
|
|
xcbutilwm,
|
|
|
|
xwayland,
|
2022-07-27 13:57:27 +02:00
|
|
|
debug ? false,
|
2022-05-17 13:11:24 +02:00
|
|
|
enableXWayland ? true,
|
2023-03-22 16:21:17 +01:00
|
|
|
hidpiXWayland ? false,
|
2022-07-27 13:57:27 +02:00
|
|
|
legacyRenderer ? false,
|
2022-09-01 19:35:50 +02:00
|
|
|
nvidiaPatches ? false,
|
2023-01-05 20:17:55 +01:00
|
|
|
withSystemd ? true,
|
2022-05-17 13:11:24 +02:00
|
|
|
version ? "git",
|
2023-03-04 16:34:15 +01:00
|
|
|
commit,
|
2022-08-29 15:51:39 +02:00
|
|
|
}: let
|
|
|
|
assertXWayland = lib.assertMsg (hidpiXWayland -> enableXWayland) ''
|
|
|
|
Hyprland: cannot have hidpiXWayland when enableXWayland is false.
|
|
|
|
'';
|
|
|
|
in
|
|
|
|
assert assertXWayland;
|
|
|
|
stdenv.mkDerivation {
|
|
|
|
pname = "hyprland" + lib.optionalString debug "-debug";
|
|
|
|
inherit version;
|
2022-08-12 22:12:24 +02:00
|
|
|
|
2022-08-29 15:51:39 +02:00
|
|
|
src = lib.cleanSourceWith {
|
|
|
|
filter = name: type: let
|
|
|
|
baseName = baseNameOf (toString name);
|
|
|
|
in
|
|
|
|
! (
|
|
|
|
lib.hasSuffix ".nix" baseName
|
|
|
|
);
|
|
|
|
src = lib.cleanSource ../.;
|
|
|
|
};
|
2022-05-08 18:27:40 +02:00
|
|
|
|
2022-08-29 15:51:39 +02:00
|
|
|
nativeBuildInputs = [
|
2023-01-06 15:31:57 +01:00
|
|
|
jq
|
2022-08-29 15:51:39 +02:00
|
|
|
meson
|
|
|
|
ninja
|
|
|
|
pkg-config
|
|
|
|
];
|
2022-05-08 18:27:40 +02:00
|
|
|
|
2022-08-29 15:51:39 +02:00
|
|
|
outputs = [
|
|
|
|
"out"
|
|
|
|
"man"
|
|
|
|
];
|
2022-08-21 17:58:03 +02:00
|
|
|
|
2022-08-29 15:51:39 +02:00
|
|
|
buildInputs =
|
|
|
|
[
|
|
|
|
git
|
2022-12-19 13:13:07 +01:00
|
|
|
cairo
|
2023-01-07 19:25:20 +01:00
|
|
|
hyprland-protocols
|
2022-08-29 15:51:39 +02:00
|
|
|
libdrm
|
|
|
|
libinput
|
|
|
|
libxkbcommon
|
|
|
|
mesa
|
2023-03-20 17:22:34 +01:00
|
|
|
pango
|
2023-02-27 13:32:38 +01:00
|
|
|
udis86
|
2022-08-29 15:51:39 +02:00
|
|
|
wayland
|
|
|
|
wayland-protocols
|
|
|
|
wayland-scanner
|
2022-11-11 13:35:28 +01:00
|
|
|
pciutils
|
2022-09-01 19:35:50 +02:00
|
|
|
(wlroots.override {inherit enableXWayland hidpiXWayland nvidiaPatches;})
|
2022-08-29 15:51:39 +02:00
|
|
|
]
|
2023-01-05 20:17:55 +01:00
|
|
|
++ lib.optionals enableXWayland [libxcb xcbutilwm xwayland]
|
|
|
|
++ lib.optionals withSystemd [systemd];
|
2022-05-17 13:11:24 +02:00
|
|
|
|
2022-08-29 15:51:39 +02:00
|
|
|
mesonBuildType =
|
|
|
|
if debug
|
|
|
|
then "debug"
|
|
|
|
else "release";
|
2022-05-08 18:27:40 +02:00
|
|
|
|
2022-08-29 15:51:39 +02:00
|
|
|
mesonFlags = builtins.concatLists [
|
|
|
|
(lib.optional (!enableXWayland) "-Dxwayland=disabled")
|
|
|
|
(lib.optional legacyRenderer "-DLEGACY_RENDERER:STRING=true")
|
2023-01-05 20:17:55 +01:00
|
|
|
(lib.optional withSystemd "-Dsystemd=enabled")
|
2022-08-29 15:51:39 +02:00
|
|
|
];
|
2022-05-08 20:18:13 +02:00
|
|
|
|
2022-08-29 15:51:39 +02:00
|
|
|
patches = [
|
|
|
|
# make meson use the provided wlroots instead of the git submodule
|
|
|
|
./meson-build.patch
|
|
|
|
];
|
2022-05-08 18:27:40 +02:00
|
|
|
|
2022-08-29 15:51:39 +02:00
|
|
|
postPatch = ''
|
2023-01-05 20:17:55 +01:00
|
|
|
# Fix hardcoded paths to /usr installation
|
2022-08-29 15:51:39 +02:00
|
|
|
sed -i "s#/usr#$out#" src/render/OpenGL.cpp
|
2023-03-04 16:34:15 +01:00
|
|
|
substituteInPlace meson.build \
|
|
|
|
--replace "@GIT_COMMIT_HASH@" '${commit}' \
|
|
|
|
--replace "@GIT_DIRTY@" '${if commit == "" then "dirty" else ""}'
|
2022-08-29 15:51:39 +02:00
|
|
|
'';
|
2022-07-08 16:46:42 +02:00
|
|
|
|
2022-08-29 15:51:39 +02:00
|
|
|
passthru.providedSessions = ["hyprland"];
|
2022-05-16 12:33:00 +02:00
|
|
|
|
2022-08-29 15:51:39 +02:00
|
|
|
meta = with lib; {
|
|
|
|
homepage = "https://github.com/vaxerski/Hyprland";
|
|
|
|
description = "A dynamic tiling Wayland compositor that doesn't sacrifice on its looks";
|
|
|
|
license = licenses.bsd3;
|
|
|
|
platforms = platforms.linux;
|
|
|
|
mainProgram = "Hyprland";
|
|
|
|
};
|
|
|
|
}
|