nix-config/home/xdg/default.nix
Bruno BELANYI 323e99bbb0
All checks were successful
continuous-integration/drone/push Build is passing
home: xdg: make gdb store history in XDG_DATA_HOME
2021-10-08 12:46:00 +02:00

51 lines
1.3 KiB
Nix

{ config, lib, ... }:
let
cfg = config.my.home.xdg;
in
{
options.my.home.xdg = with lib.my; {
enable = mkDisableOption "XDG configuration";
};
config.xdg = lib.mkIf cfg.enable {
enable = true;
# File types
mime.enable = true;
# File associatons
mimeApps = {
enable = true;
};
# User directories
userDirs = {
enable = true;
# I want them lowercased
desktop = "\$HOME/desktop";
documents = "\$HOME/documents";
download = "\$HOME/downloads";
music = "\$HOME/music";
pictures = "\$HOME/pictures";
publicShare = "\$HOME/public";
templates = "\$HOME/templates";
videos = "\$HOME/videos";
};
# A tidy home is a tidy mind
dataFile = {
"bash/.keep".text = "";
"gdb/.keep".text = "";
"tig/.keep".text = "";
};
};
# I want a tidier home
config.home.sessionVariables = with config.xdg; lib.mkIf cfg.enable {
CARGO_HOME = "${dataHome}/cargo";
DOCKER_CONFIG = "${configHome}/docker";
GDBHISTFILE = "${dataHome}/gdb/gdb_history";
HISTFILE = "${dataHome}/bash/history";
INPUTRC = "${configHome}/readline/inputrc";
LESSHISTFILE = "${dataHome}/less/history";
LESSKEY = "${configHome}/less/lesskey";
WGETRC = "${configHome}/wgetrc";
};
}