aboutsummaryrefslogtreecommitdiff
path: root/home-manager/modules/misc/debug.nix
diff options
context:
space:
mode:
Diffstat (limited to 'home-manager/modules/misc/debug.nix')
-rw-r--r--home-manager/modules/misc/debug.nix26
1 files changed, 26 insertions, 0 deletions
diff --git a/home-manager/modules/misc/debug.nix b/home-manager/modules/misc/debug.nix
new file mode 100644
index 00000000000..d27d496b423
--- /dev/null
+++ b/home-manager/modules/misc/debug.nix
@@ -0,0 +1,26 @@
+{ config, pkgs, lib, ... }:
+
+with lib;
+
+{
+ options.home = {
+ enableDebugInfo = mkEnableOption "" // {
+ description = ''
+ Some Nix-packages provide debug symbols for
+ <command>gdb</command> in the <literal>debug</literal>-output.
+ This option ensures that those are automatically fetched from
+ the binary cache if available and <command>gdb</command> is
+ configured to find those symbols.
+ '';
+ };
+ };
+
+ config = mkIf config.home.enableDebugInfo {
+ home.extraOutputsToInstall = [ "debug" ];
+
+ home.sessionVariables = {
+ NIX_DEBUG_INFO_DIRS =
+ "$NIX_DEBUG_INFO_DIRS\${NIX_DEBUG_INFO_DIRS:+:}${config.home.profileDirectory}/lib/debug";
+ };
+ };
+}