diff --git a/src/modules/languages/c.nix b/src/modules/languages/c.nix index 963a95578..33025284d 100644 --- a/src/modules/languages/c.nix +++ b/src/modules/languages/c.nix @@ -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 { @@ -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; }; }