Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add debugger tools to C language pack #1216

Merged
merged 3 commits into from
Jun 12, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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;
};
}
Loading