From 7d5793a4dbbbc482a678c32d69ff330d01f58ba0 Mon Sep 17 00:00:00 2001 From: Tristan Schrader Date: Mon, 6 Jan 2025 15:46:46 -0800 Subject: [PATCH] fix: libxkbcommon + pkg-config for linux devshell Because libxkbcommon is needed during package build now on Linux, we have to included it as a package and configure it for access by smithay-client-toolkit with pkg-config --- nix/default.nix | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/nix/default.nix b/nix/default.nix index 3d3114e4..fcc3a82d 100644 --- a/nix/default.nix +++ b/nix/default.nix @@ -11,17 +11,19 @@ system, ... }: let - inherit (pkgs) alejandra cargo cmake deno gauntlet gtk3 libxkbcommon libGL mkShell nodejs protobuf stdenv xorg wayland; + inherit (lib) makeBinPath makeLibraryPath optionals optionalString; + inherit (pkgs) alejandra cargo cmake deno gauntlet gtk3 libxkbcommon libGL mkShell nodejs pkg-config protobuf stdenv xorg wayland; + inherit (stdenv.hostPlatform) isLinux; in { _module.args.pkgs = import inputs.nixpkgs { inherit system; overlays = [inputs.self.overlays.default]; }; devShells.default = mkShell { - packages = [cargo cmake deno nodejs protobuf]; - shellHook = lib.optionalString stdenv.hostPlatform.isLinux '' - export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:${lib.makeLibraryPath [libxkbcommon libGL xorg.libX11 wayland]}" - export PATH="$PATH:${lib.makeBinPath [gtk3]}" + packages = [cargo cmake deno nodejs protobuf] ++ optionals isLinux [libxkbcommon pkg-config]; + shellHook = optionalString isLinux '' + export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:${makeLibraryPath [libGL xorg.libX11 wayland]}" + export PATH="$PATH:${makeBinPath [gtk3]}" ''; }; formatter = alejandra;