NixOS and Home Manager config

refactor: bash: move env vars to home.sessionVariables

nel.pet 8cda0522 78a93d64

verified
Changed files
+27 -22
modules
-22
modules/home/bash.nix
···
fi
'';
profileExtra = ''
-
# Java + tooling env variables
-
export JAVA_HOME="/etc/alternatives/java_sdk"
-
export GRADLE_USER_HOME="$HOME/.local/share/gradle"
-
. "$HOME/.maven_credentials"
-
-
# Added by Toolbox App
-
export PATH="$PATH:/home/nel/.local/share/JetBrains/Toolbox/scripts"
-
-
# Cargo
-
export CARGO_HOME="/home/nel/.local/share/cargo"
-
. "$CARGO_HOME/env"
-
-
# GO
-
export GOPATH="$HOME/.local/share/go"
-
-
# Make (some) GTK apps behave
-
export GTK_CSD=0
-
export GTK_USE_PORTAL=1
-
-
# Steam applications and icons
-
export XDG_DATA_DIRS="$XDG_DATA_DIRS:$HOME/.var/app/com.valvesoftware.Steam/data/"
-
# Update helper
update() {
sudo dnf update --refresh
+1
modules/home/default.nix
···
./cli.nix
./direnv.nix
./bash.nix
+
./envvars.nix
];
home.username = "nel";
+26
modules/home/envvars.nix
···
+
{ config, ... }: {
+
home.sessionVariables = {
+
JAVA_HOME = "/etc/alternatives/java_sdk";
+
GRADLE_USER_HOME = "${config.home.homeDirectory}/.local/share/gradle";
+
+
# Added by Toolbox App
+
PATH = "$PATH:${config.home.homeDirectory}/.local/share/JetBrains/Toolbox/scripts";
+
+
# Cargo
+
CARGO_HOME = "${config.home.homeDirectory}/.local/share/cargo";
+
+
# GO
+
GOPATH = "${config.home.homeDirectory}/.local/share/go";
+
+
# Make (some) GTK apps behave
+
GTK_CSD = 0;
+
GTK_USE_PORTAL = 1;
+
+
# Steam applications and icons
+
XDG_DATA_DIRS = "$XDG_DATA_DIRS:${config.home.homeDirectory}/.var/app/com.valvesoftware.Steam/data/";
+
};
+
home.sessionVariablesExtra = ''
+
. "${config.home.homeDirectory}/.maven_credentials"
+
. "${config.home.sessionVariables.CARGO_HOME}/env"
+
'';
+
}