aboutsummaryrefslogtreecommitdiffhomepage
path: root/default.nix
blob: fcee67fde8387bf298a3a2e58133c42a5941261b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
{ lib, stdenv, fetchFromGitHub, src, pkg-config, cmake, ninja, libdrm, libinput
, libxcb, libxkbcommon, mesa, mount, pango, wayland, wayland-protocols
, wayland-scanner, wlroots, xcbutilwm, xwayland, enableXWayland ? true }:

stdenv.mkDerivation rec {
  pname = "hyprland";
  version = "git";
  inherit src;

  nativeBuildInputs = [ cmake ninja pkg-config wayland ]
    ++ lib.optional enableXWayland xwayland;

  buildInputs = [
    libdrm
    libinput
    libxcb
    libxkbcommon
    mesa
    pango
    wayland-protocols
    wayland-scanner
    wlroots
    (wlroots.override { inherit enableXWayland; })
    xcbutilwm
  ];

  cmakeFlags = [ "-DCMAKE_BUILD_TYPE=Release" ]
    ++ lib.optional (!enableXWayland) "-DNO_XWAYLAND=true";

  prePatch = ''
    make config
  '';

  postBuild = ''
    pushd ../hyprctl
    make all
    popd
  '';

  installPhase = ''
    cd ../
    mkdir -p $out/share/wayland-sessions
    cp ./example/hyprland.desktop $out/share/wayland-sessions
    mkdir -p $out/bin
    cp ./build/Hyprland $out/bin
    cp ./hyprctl/hyprctl $out/bin
    mkdir -p $out/share/hyprland
    cp ./assets/wall_2K.png $out/share/hyprland
    cp ./assets/wall_4K.png $out/share/hyprland
    cp ./assets/wall_8K.png $out/share/hyprland
  '';

  passthru.providedSessions = [ "hyprland" ];

  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;
  };
}