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

41 lines
777 B
Nix
Raw 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";
2024-07-08 15:12:21 +02:00
package = mkPackageOption pkgs "gdb" { };
2021-08-21 01:13:14 +02:00
rr = {
enable = my.mkDisableOption "rr configuration";
2021-08-20 20:03:30 +02:00
2024-07-08 15:10:07 +02:00
package = mkPackageOption pkgs "rr" { };
2021-08-21 01:13:14 +02:00
};
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; [
2024-07-08 15:12:21 +02:00
cfg.package
2021-08-21 01:13:14 +02:00
];
xdg = {
configFile."gdb/gdbinit".source = ./gdbinit;
stateFile."gdb/.keep".text = "";
};
home.sessionVariables = {
GDBHISTFILE = "${config.xdg.stateHome}/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
}