nix-configs/home-modules/xdg.nix

38 lines
1.3 KiB
Nix

{
config,
lib,
osConfig,
...
}:
{
xdg.enable = true;
home = {
preferXdgDirectories = true;
sessionVariables = {
ANDROID_USER_HOME = "${config.xdg.dataHome}/android";
CARGO_HOME = "${config.xdg.dataHome}/cargo";
DOTNET_CLI_HOME = "${config.xdg.dataHome}/dotnet";
DVDCSS_CACHE = "${config.xdg.dataHome}/dvdcss";
GRADLE_USER_HOME = "${config.xdg.dataHome}/gradle";
JAVA_OPTIONS = "-Djava.util.prefs.userRoot=${config.xdg.configHome}/java";
NODE_REPL_HISTORY = "${config.xdg.stateHome}/node_repl_history";
NPM_CONFIG_USERCONFIG = "${config.xdg.configHome}/npm/npmrc";
PYTHON_HISTORY = "${config.xdg.stateHome}/python_history";
RUSTUP_HOME = "${config.xdg.dataHome}/rustup";
XCOMPOSE_CACHE = "${config.xdg.cacheHome}/X11/xcompose";
};
shellAliases = {
adb = ''HOME="${config.xdg.dataHome}/android" adb'';
mvn = "mvn -gs ${config.xdg.configHome}/maven/settings.xml";
wget = "wget --hsts-file=${config.xdg.dataHome}/wget-hsts";
};
file = {
".nix-profile" = {
source = config.lib.file.mkOutOfStoreSymlink "${config.xdg.stateHome}/nix/profile";
};
};
};
gtk.gtk2.configLocation = lib.mkIf osConfig.services.displayManager.enable "${config.xdg.configHome}/gtk-2.0/gtkrc";
}