15 lines
296 B
Bash
15 lines
296 B
Bash
# shellcheck shell=bash
|
|
# This setup hook set the HOME environment variable to a writable directory.
|
|
|
|
export HOME
|
|
|
|
writableTmpDirAsHome () {
|
|
if [ ! -w "$HOME" ]; then
|
|
HOME="$NIX_BUILD_TOP/.home"
|
|
mkdir -p "$HOME"
|
|
export HOME
|
|
fi
|
|
}
|
|
|
|
postHooks+=(writableTmpDirAsHome)
|