From 468c4bd474ea58d4afaa127f465cd2e528908f4a Mon Sep 17 00:00:00 2001 From: Asmir A Date: Sun, 3 Sep 2023 20:11:47 +0200 Subject: [PATCH] flake: add a hack to fix build not finding libevdev/libevdev.h --- flake.nix | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/flake.nix b/flake.nix index 1dd7176..6fae284 100644 --- a/flake.nix +++ b/flake.nix @@ -11,18 +11,23 @@ version = "0.1"; src = self; nativeBuildInputs = [zig.hook]; - buildInputs = [libevdev]; + buildInputs = [libevdev pkg-config]; + buildPhase = '' + NIX_CFLAGS_COMPILE="-isystem $(pkg-config --variable=includedir libevdev)/libevdev-1.0 $NIX_CFLAGS_COMPILE" + ''; }; devShells.x86_64-linux.default = with import nixpkgs {system = "x86_64-linux";}; mkShell { + nativeBuildInputs = [zig]; buildInputs = [ libevdev - zig + pkg-config ]; shellHook = '' - echo "happy hacking!" + NIX_CFLAGS_COMPILE="-isystem $(pkg-config --variable=includedir libevdev)/libevdev-1.0 $NIX_CFLAGS_COMPILE" + echo "happy hacking!" ''; }; };