nix: add hyprland-protocols and streamline build

This commit is contained in:
Mihai Fufezan 2022-12-04 22:55:47 +02:00
parent 6d6c5547b4
commit 3be001b747
No known key found for this signature in database
GPG Key ID: 5899325F2F120900
5 changed files with 47 additions and 4 deletions

View File

@ -1,5 +1,21 @@
{
"nodes": {
"hyprland-protocols": {
"flake": false,
"locked": {
"lastModified": 1670185345,
"narHash": "sha256-hxWGqlPecqEsE6nOHDV29KFBKePbY2Ipeac6lrChMKY=",
"owner": "hyprwm",
"repo": "hyprland-protocols",
"rev": "4623a404c091e64743ba310199bb380ec52f1936",
"type": "github"
},
"original": {
"owner": "hyprwm",
"repo": "hyprland-protocols",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1669969257,
@ -18,6 +34,7 @@
},
"root": {
"inputs": {
"hyprland-protocols": "hyprland-protocols",
"nixpkgs": "nixpkgs"
}
}

View File

@ -1,13 +1,20 @@
{
description = "xdg-desktop-portal-hyprland";
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
hyprland-protocols = {
url = "github:hyprwm/hyprland-protocols";
flake = false;
};
};
outputs = {
self,
nixpkgs,
...
}: let
} @ inputs: let
inherit (nixpkgs) lib;
genSystems = lib.genAttrs [
"aarch64-linux"
@ -23,6 +30,7 @@
overlays.default = _: prev: {
xdg-desktop-portal-hyprland = prev.callPackage ./nix/default.nix {
version = "0.pre" + "+date=" + (mkDate (self.lastModifiedDate or "19700101")) + "_" + (self.shortRev or "dirty");
inherit (inputs) hyprland-protocols;
};
};

View File

@ -100,7 +100,7 @@ executable(
],
include_directories: [inc],
install: true,
install_dir: 'libexecdir',
install_dir: get_option('libexecdir'),
)
conf_data = configuration_data()

View File

@ -9,6 +9,7 @@
wayland-protocols,
wayland-scanner,
grim,
hyprland-protocols,
inih,
libdrm,
mesa,
@ -32,6 +33,12 @@ in
nativeBuildInputs = [meson ninja pkg-config wayland-scanner makeWrapper];
buildInputs = [inih libdrm mesa pipewire systemd wayland wayland-protocols];
preConfigure = ''
rmdir protocols/hyprland-protocols
ln -s ${hyprland-protocols.outPath}/ protocols/hyprland-protocols
'';
mesonFlags = [
"-Dsd-bus-provider=libsystemd"
];

View File

@ -3,7 +3,10 @@
lib,
cmake,
qtbase,
makeShellWrapper,
wrapQtAppsHook,
grim,
slurp,
version ? "git",
...
}:
@ -12,6 +15,14 @@ stdenv.mkDerivation {
inherit version;
src = ../hyprland-share-picker;
nativeBuildInputs = [cmake wrapQtAppsHook];
nativeBuildInputs = [cmake wrapQtAppsHook makeShellWrapper];
buildInputs = [qtbase];
dontWrapQtApps = true;
postInstall = ''
wrapProgramShell $out/bin/hyprland-share-picker \
"''${qtWrapperArgs[@]}" \
--prefix PATH ":" ${lib.makeBinPath [grim slurp]}
'';
}