nix-config/modules/home/gdb/default.nix
Bruno BELANYI fbd3b70d61
All checks were successful
ci/woodpecker/push/check Pipeline was successful
home: use 'XDG_STATE_HOME' for history files
It's specified as the place to put them, so let's make use of it I
guess.
2024-09-06 20:52:30 +01:00

41 lines
777 B
Nix

{ config, lib, pkgs, ... }:
let
cfg = config.my.home.gdb;
in
{
options.my.home.gdb = with lib; {
enable = my.mkDisableOption "gdb configuration";
package = mkPackageOption pkgs "gdb" { };
rr = {
enable = my.mkDisableOption "rr configuration";
package = mkPackageOption pkgs "rr" { };
};
};
config = lib.mkIf cfg.enable (lib.mkMerge [
{
home.packages = with pkgs; [
cfg.package
];
xdg = {
configFile."gdb/gdbinit".source = ./gdbinit;
stateFile."gdb/.keep".text = "";
};
home.sessionVariables = {
GDBHISTFILE = "${config.xdg.stateHome}/gdb/gdb_history";
};
}
(lib.mkIf cfg.rr.enable {
home.packages = [
cfg.rr.package
];
})
]);
}