nix-config/modules/home/gdb/default.nix

46 lines
883 B
Nix
Raw Permalink Normal View History

2021-08-20 20:03:30 +02:00
{ config, lib, pkgs, ... }:
let
cfg = config.my.home.gdb;
in
{
options.my.home.gdb = with lib; {
enable = my.mkDisableOption "gdb configuration";
2021-08-21 01:13:14 +02:00
rr = {
enable = my.mkDisableOption "rr configuration";
2021-08-20 20:03:30 +02:00
2021-08-21 01:13:14 +02:00
package = mkOption {
type = types.package;
default = pkgs.rr;
defaultText = literalExample "pkgs.rr";
description = ''
Package providing rr
'';
};
};
2021-08-20 20:03:30 +02:00
};
2021-08-21 01:13:14 +02:00
config = lib.mkIf cfg.enable (lib.mkMerge [
{
2021-08-21 01:13:14 +02:00
home.packages = with pkgs; [
gdb
];
xdg = {
configFile."gdb/gdbinit".source = ./gdbinit;
dataFile. "gdb/.keep".text = "";
};
home.sessionVariables = {
GDBHISTFILE = "${config.xdg.dataHome}/gdb/gdb_history";
};
}
2021-08-21 01:13:14 +02:00
(lib.mkIf cfg.rr.enable {
home.packages = [
cfg.rr.package
];
})
]);
2021-08-20 20:03:30 +02:00
}