xdg-ninja

This commit is contained in:
jacekpoz 2024-02-15 10:34:27 +01:00
parent 723691a46a
commit 993bb11a26
No known key found for this signature in database
GPG key ID: 94E812A8B12AAE3C
4 changed files with 55 additions and 6 deletions

View file

@ -142,14 +142,9 @@
environment = { environment = {
sessionVariables = { sessionVariables = {
GOPATH = "\$HOME/.local/share/go";
MOZ_ENABLE_WAYLAND = "1"; MOZ_ENABLE_WAYLAND = "1";
MOZ_DRM_DEVICE = "/dev/dri/card0"; MOZ_DRM_DEVICE = "/dev/dri/card0";
HISTFILE = "\${XDG_STATE_HOME}/bash/history";
CARGO_HOME = "\${XDG_DATA_HOME}/cargo";
CHROME_EXECUTABLE = "${pkgs.ungoogled-chromium}/bin/chromium"; CHROME_EXECUTABLE = "${pkgs.ungoogled-chromium}/bin/chromium";
#NIXOS_OZONE_WL = "1"; #NIXOS_OZONE_WL = "1";

View file

@ -202,6 +202,7 @@
httpie httpie
mangohud mangohud
nix-index nix-index
xdg-ninja
]; ];
}; };
} }

View file

@ -53,7 +53,6 @@ in {
gs = "g stash"; gs = "g stash";
n = "nix"; n = "nix";
woman = "man"; woman = "man";
wget = "wget --hsts-file=\"${config.home-manager.users.${config'.username}.xdg.dataHome}/wget-hsts\"";
open = "xdg-open"; open = "xdg-open";
":q" = "exit"; ":q" = "exit";
} // cfg.extraAliases; } // cfg.extraAliases;

View file

@ -13,7 +13,61 @@
image_viewer = "imv.desktop"; image_viewer = "imv.desktop";
text_editor = "nvim.desktop"; text_editor = "nvim.desktop";
in { in {
environment.sessionVariables = {
ANDROID_HOME = "${hmCfg.xdg.dataHome}/android";
CARGO_HOME = "${hmCfg.xdg.dataHome}/cargo";
DOTNET_CLI_HOME = "${hmCfg.xdg.dataHome}/dotnet";
GOPATH = "${hmCfg.xdg.dataHome}/go";
GNUPGHOME = "${hmCfg.xdg.dataHome}/gnupg";
GRADLE_USER_HOME = "${hmCfg.xdg.dataHome}/gradle";
HISTFILE = "${hmCfg.xdg.stateHome}/bash/history";
MYSQL_HISTFILE = "${hmCfg.xdg.stateHome}/mysql/history";
NPM_CONFIG_USERCONFIG = "${hmCfg.xdg.configHome}/npm/npmrc";
NUGET_PACKAGES = "${hmCfg.xdg.cacheHome}/NuGetPackages";
_JAVA_OPTIONS = "-Djava.util.prefs.userRoot=${hmCfg.xdg.configHome}/java";
PARALLEL_HOME = "${hmCfg.xdg.configHome}/parallel";
PYTHONSTARTUP = "${hmCfg.xdg.configHome}/python/pythonrc";
RUSTUP_HOME = "${hmCfg.xdg.dataHome}/rustup";
WINEPREFIX = "${hmCfg.xdg.dataHome}/wine";
XAUTHORITY = "\$XDG_RUNTIME_DIR/Xauthority";
};
myOptions.programs.zsh.extraAliases = {
gdb = "gdb -n -x ${hmCfg.xdg.configHome}/gdb/init";
pidgin = "pidgin --config=${hmCfg.xdg.dataHome}/purple";
svn = "svn --config-dir ${hmCfg.xdg.configHome}/subversion";
wget = "wget --hsts-file=\"${hmCfg.xdg.dataHome}/wget-hsts\"";
};
home-manager.users.${config'.username} = { home-manager.users.${config'.username} = {
xdg.configFile."npm/npmrc".text = ''
prefix=${hmCfg.xdg.dataHome}/npm
cache=${hmCfg.xdg.cacheHome}/npm
tmp=\$XDG_RUNTIME_DIR/npm
init-module=${hmCfg.xdg.configHome}/npm/config/npm-init.js
'';
xdg.configFile."python/pythonrc".text = ''
import os
import atexit
import readline
history = os.path.join(os.environ['XDG_CACHE_HOME'], 'python_history')
try:
readline.read_history_file(history)
except OSError:
pass
def write_history():
try:
readline.write_history_file(history)
except OSError:
pass
atexit.register(write_history)
'';
xdg = { xdg = {
cacheHome = "${hmCfg.home.homeDirectory}/.cache"; cacheHome = "${hmCfg.home.homeDirectory}/.cache";
configHome = "${hmCfg.home.homeDirectory}/.config"; configHome = "${hmCfg.home.homeDirectory}/.config";