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
|
|
|
|
2023-08-13 17:07:33 +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
|
|
|
];
|
|
|
|
|
2024-03-11 19:13:41 +01:00
|
|
|
xdg = {
|
|
|
|
configFile."gdb/gdbinit".source = ./gdbinit;
|
2024-08-29 12:10:26 +02:00
|
|
|
stateFile."gdb/.keep".text = "";
|
2024-03-11 19:13:41 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
home.sessionVariables = {
|
2024-08-29 12:10:26 +02:00
|
|
|
GDBHISTFILE = "${config.xdg.stateHome}/gdb/gdb_history";
|
2024-03-11 19:13:41 +01:00
|
|
|
};
|
2023-08-13 17:07:33 +02:00
|
|
|
}
|
2021-08-21 01:13:14 +02:00
|
|
|
|
|
|
|
(lib.mkIf cfg.rr.enable {
|
|
|
|
home.packages = [
|
|
|
|
cfg.rr.package
|
|
|
|
];
|
|
|
|
})
|
2023-08-13 17:07:33 +02:00
|
|
|
]);
|
2021-08-20 20:03:30 +02:00
|
|
|
}
|