diff options
| author | Fernando Ayats <ayatsfer@gmail.com> | 2022-05-17 13:11:24 +0200 |
|---|---|---|
| committer | Fernando Ayats <ayatsfer@gmail.com> | 2022-05-17 13:11:24 +0200 |
| commit | 0728326d6e2834cb339337e7bcb19ff0bdfbd263 (patch) | |
| tree | bb89a51598c6fa1e5541733aceace554bb859a0d /default.nix | |
| parent | 48b8ab3f6538df29c4e0f50a5fbb7808fd4c475b (diff) | |
nix: flake cleanup
- Removed all outputs except for "packages"
- Track nixos-unstable instead of stable
- Cleanup installPhase
Diffstat (limited to 'default.nix')
| -rw-r--r-- | default.nix | 93 |
1 files changed, 57 insertions, 36 deletions
diff --git a/default.nix b/default.nix index fcee67fd..a5abdd5d 100644 --- a/default.nix +++ b/default.nix @@ -1,30 +1,55 @@ -{ 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 { +{ + lib, + stdenv, + fetchFromGitHub, + pkg-config, + cmake, + ninja, + libdrm, + libinput, + libxcb, + libxkbcommon, + mesa, + mount, + pango, + wayland, + wayland-protocols, + wayland-scanner, + wlroots, + xcbutilwm, + xwayland, + enableXWayland ? true, + version ? "git", +}: +stdenv.mkDerivation { pname = "hyprland"; - version = "git"; - inherit src; - - nativeBuildInputs = [ cmake ninja pkg-config wayland ] - ++ lib.optional enableXWayland xwayland; + inherit version; + src = ./.; - buildInputs = [ - libdrm - libinput - libxcb - libxkbcommon - mesa - pango - wayland-protocols - wayland-scanner - wlroots - (wlroots.override { inherit enableXWayland; }) - xcbutilwm + nativeBuildInputs = [ + cmake + ninja + pkg-config ]; - cmakeFlags = [ "-DCMAKE_BUILD_TYPE=Release" ] + buildInputs = + [ + libdrm + libinput + libxcb + libxkbcommon + mesa + pango + wayland + wayland-protocols + wayland-scanner + (wlroots.override {inherit enableXWayland;}) + xcbutilwm + ] + ++ lib.optional enableXWayland xwayland; + + cmakeFlags = + ["-DCMAKE_BUILD_TYPE=Release"] ++ lib.optional (!enableXWayland) "-DNO_XWAYLAND=true"; prePatch = '' @@ -38,25 +63,21 @@ stdenv.mkDerivation rec { ''; 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 + pushd .. + install -Dm644 ./example/hyprland.desktop -t $out/share/wayland-sessions + install -Dm755 ./build/Hyprland -t $out/bin + install -Dm755 ./hyprctl/hyprctl -t $out/bin + install -Dm644 ./assets/* -t $out/share/hyprland + popd ''; - passthru.providedSessions = [ "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"; + description = "A dynamic tiling Wayland compositor that doesn't sacrifice on its looks"; license = licenses.bsd3; platforms = platforms.linux; + mainProgram = "Hyprland"; }; } |
