Skip to content

Commit

Permalink
Merge pull request #1216 from k3yss/work/keys/c-language-debugger
Browse files Browse the repository at this point in the history
Add debugger tools to C language pack
  • Loading branch information
sandydoo authored Jun 12, 2024
2 parents bb177c4 + 55ec49b commit ad779fe
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion src/modules/languages/c.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,19 @@ in
{
options.languages.c = {
enable = lib.mkEnableOption "tools for C development";

debugger = lib.mkOption {
type = lib.types.nullOr lib.types.package;
default =
if lib.meta.availableOn pkgs.stdenv.hostPlatform pkgs.gdb
then pkgs.gdb
else null;
defaultText = lib.literalExpression "pkgs.gdb";
description = ''
An optional debugger package to use with c.
The default is `gdb`, if supported on the current system.
'';
};
};

config = lib.mkIf cfg.enable {
Expand All @@ -14,6 +27,7 @@ in
gnumake
ccls
pkg-config
];
] ++ lib.optional (cfg.debugger != null) cfg.debugger
++ lib.optional (lib.meta.availableOn pkgs.stdenv.hostPlatform pkgs.valgrind && !pkgs.valgrind.meta.broken) pkgs.valgrind;
};
}

0 comments on commit ad779fe

Please sign in to comment.