From 0aa88f2f492302d5c785ecce79d6b1e6efa7ee0d Mon Sep 17 00:00:00 2001 From: John Soo Date: Thu, 21 Apr 2022 10:12:22 -0700 Subject: [PATCH 1/2] Add debug symbols to nix-shell. --- shell.nix | 3 +++ 1 file changed, 3 insertions(+) diff --git a/shell.nix b/shell.nix index 4d785cb..bbaa60d 100644 --- a/shell.nix +++ b/shell.nix @@ -32,4 +32,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}" + ''; }) From 6ef1b314d7c23024ef37df7f22c9f6208645f77c Mon Sep 17 00:00:00 2001 From: adisbladis Date: Fri, 22 Apr 2022 18:42:17 +1200 Subject: [PATCH 2/2] 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}" ''; })