From 6ef1b314d7c23024ef37df7f22c9f6208645f77c Mon Sep 17 00:00:00 2001 From: adisbladis Date: Fri, 22 Apr 2022 18:42:17 +1200 Subject: [PATCH] Only add debug symbols to shell on Linux --- shell.nix | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/shell.nix b/shell.nix index bbaa60d..4517278 100644 --- a/shell.nix +++ b/shell.nix @@ -13,9 +13,13 @@ , srcDir ? null }: -(pkgs.callPackage ./default.nix { - inherit srcDir; +let + inherit (pkgs) lib stdenv; nix = pkgs.nixUnstable; + +in +(pkgs.callPackage ./default.nix { + inherit nix srcDir; }).overrideAttrs (old: { src = null; @@ -32,7 +36,7 @@ ]; - shellHook = '' - export NIX_DEBUG_INFO_DIRS="${pkgs.curl.debug}/lib/debug:${pkgs.nixUnstable.debug}/lib/debug''${NIX_DEBUG_INFO_DIRS:+:$NIX_DEBUG_INFO_DIRS}" + shellHook = lib.optionalString stdenv.isLinux '' + export NIX_DEBUG_INFO_DIRS="${pkgs.curl.debug}/lib/debug:${nix.debug}/lib/debug''${NIX_DEBUG_INFO_DIRS:+:$NIX_DEBUG_INFO_DIRS}" ''; })