nix-config/home/xdg/default.nix

50 lines
1.2 KiB
Nix
Raw Normal View History

2021-03-10 19:52:13 +01:00
{ config, lib, ... }:
let
cfg = config.my.home.xdg;
in
2021-02-21 20:30:21 +01:00
{
2023-03-16 17:39:13 +01:00
options.my.home.xdg = with lib; {
enable = my.mkDisableOption "XDG configuration";
2021-03-10 19:52:13 +01:00
};
config.xdg = lib.mkIf cfg.enable {
2021-02-21 20:30:21 +01:00
enable = true;
# File types
mime.enable = true;
# File associatons
mimeApps = {
enable = true;
};
2021-02-21 20:32:54 +01:00
# 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 = "";
};
2021-02-21 20:30:21 +01:00
};
# I want a tidier home
2021-03-10 19:52:13 +01:00
config.home.sessionVariables = with config.xdg; lib.mkIf cfg.enable {
2021-03-07 18:34:10 +01:00
CARGO_HOME = "${dataHome}/cargo";
DOCKER_CONFIG = "${configHome}/docker";
GDBHISTFILE = "${dataHome}/gdb/gdb_history";
HISTFILE = "${dataHome}/bash/history";
2021-03-07 18:34:10 +01:00
INPUTRC = "${configHome}/readline/inputrc";
LESSHISTFILE = "${dataHome}/less/history";
LESSKEY = "${configHome}/less/lesskey";
};
2021-02-21 20:30:21 +01:00
}