diff --git a/nix/default.nix b/nix/default.nix index c6b1f72..85fafd4 100644 --- a/nix/default.nix +++ b/nix/default.nix @@ -16,33 +16,37 @@ slurp, systemd, wayland, - src, + libsForQt5, version ? "git", -}: -stdenv.mkDerivation { - pname = "xdg-desktop-portal-hyprland"; - inherit version; +}: let + hyprland-share-picker = libsForQt5.callPackage ./hyprland-share-picker.nix {inherit version;}; +in + stdenv.mkDerivation { + pname = "xdg-desktop-portal-hyprland"; + inherit version; - src = ../.; + src = ../.; - strictDeps = true; - depsBuildBuild = [pkg-config]; - nativeBuildInputs = [meson ninja pkg-config wayland-scanner makeWrapper]; - buildInputs = [inih libdrm mesa pipewire systemd wayland wayland-protocols]; + strictDeps = true; + depsBuildBuild = [pkg-config]; + nativeBuildInputs = [meson ninja pkg-config wayland-scanner makeWrapper]; + buildInputs = [inih libdrm mesa pipewire systemd wayland wayland-protocols]; - mesonFlags = [ - "-Dsd-bus-provider=libsystemd" - ]; + mesonFlags = [ + "-Dsd-bus-provider=libsystemd" + ]; - postInstall = '' - wrapProgram $out/libexec/xdg-desktop-portal-hyprland --prefix PATH ":" ${lib.makeBinPath [grim slurp]} - ''; + postInstall = '' + ln -s ${hyprland-share-picker.outPath}/bin $out/ - meta = with lib; { - homepage = "https://github.com/emersion/xdg-desktop-portal-hyprland"; - description = "xdg-desktop-portal backend for Hyprland"; - maintainers = with maintainers; [fufexan]; - platforms = platforms.linux; - license = licenses.mit; - }; -} + wrapProgram $out/libexec/xdg-desktop-portal-hyprland --prefix PATH ":" ${lib.makeBinPath [grim slurp]} + ''; + + meta = with lib; { + homepage = "https://github.com/emersion/xdg-desktop-portal-hyprland"; + description = "xdg-desktop-portal backend for Hyprland"; + maintainers = with maintainers; [fufexan]; + platforms = platforms.linux; + license = licenses.mit; + }; + } diff --git a/nix/hyprland-share-picker.nix b/nix/hyprland-share-picker.nix new file mode 100644 index 0000000..606b7b7 --- /dev/null +++ b/nix/hyprland-share-picker.nix @@ -0,0 +1,17 @@ +{ + stdenv, + lib, + cmake, + qtbase, + wrapQtAppsHook, + version ? "git", + ... +}: +stdenv.mkDerivation { + pname = "hyprland-share-picker"; + inherit version; + src = ../hyprland-share-picker; + + nativeBuildInputs = [cmake wrapQtAppsHook]; + buildInputs = [qtbase]; +}