1
0
Fork 0
mirror of https://github.com/nix-community/home-manager synced 2024-11-10 21:29:48 +01:00

home-manager: fix assignment to read-only variable

Fixes #4519
This commit is contained in:
Robert Helgesson 2023-10-04 00:07:05 +02:00 committed by Mikilio
parent 0dd64eac14
commit 8ec4dafe89
No known key found for this signature in database
GPG key ID: 5B2F1A890CF33F3F

View file

@ -155,6 +155,11 @@ function setHomeManagerNixPath() {
# Sets some useful Home Manager related paths as global read-only variables. # Sets some useful Home Manager related paths as global read-only variables.
function setHomeManagerPathVariables() { function setHomeManagerPathVariables() {
# If called twice then just exit early.
if [[ -v HM_DATA_HOME ]]; then
return
fi
declare -r globalNixStateDir="${NIX_STATE_DIR:-/nix/var/nix}" declare -r globalNixStateDir="${NIX_STATE_DIR:-/nix/var/nix}"
declare -r globalProfilesDir="$globalNixStateDir/profiles/per-user/$USER" declare -r globalProfilesDir="$globalNixStateDir/profiles/per-user/$USER"
declare -r globalGcrootsDir="$globalNixStateDir/gcroots/per-user/$USER" declare -r globalGcrootsDir="$globalNixStateDir/gcroots/per-user/$USER"