From 9f8ec7e01050ae14d4541943bf9a9f85c056dca7 Mon Sep 17 00:00:00 2001 From: Yusuf Bera Ertan Date: Fri, 11 Dec 2020 18:00:16 +0300 Subject: [PATCH] nix: refactor crateDeps in common to look better --- nix/common.nix | 26 +++++++++----------------- 1 file changed, 9 insertions(+), 17 deletions(-) diff --git a/nix/common.nix b/nix/common.nix index 755b0e2663..cb4701ef65 100644 --- a/nix/common.nix +++ b/nix/common.nix @@ -20,24 +20,16 @@ in with pkgs; let # deps that crates need (for compiling) - crateDeps = { - libudev-sys = { - buildInputs = [ libudev ]; - nativeBuildInputs = [ pkg-config ]; + crateDeps = + let + makeDeps = b: n: { buildInputs = b; nativeBuildInputs = n; }; + in + { + libudev-sys = makeDeps [ libudev ] [ pkg-config ]; + alsa-sys = makeDeps [ alsaLib ] [ pkg-config ]; + veloren-network = makeDeps [ openssl ] [ pkg-config ]; + veloren-voxygen = makeDeps [ xorg.libxcb ] [ ]; }; - alsa-sys = { - buildInputs = [ alsaLib ]; - nativeBuildInputs = [ pkg-config ]; - }; - veloren-network = { - buildInputs = [ openssl ]; - nativeBuildInputs = [ pkg-config ]; - }; - veloren-voxygen = { - buildInputs = [ xorg.libxcb ]; - nativeBuildInputs = [ ]; - }; - }; # deps that voxygen needs to function # FIXME: Wayland doesn't work (adding libxkbcommon, wayland and wayland-protocols results in a panic)