2007-03-20 13:50:47 +00:00
|
|
|
export PATH=@wrapperDir@:/var/run/current-system/sw/bin:/var/run/current-system/sw/sbin
|
2008-01-12 23:37:17 +00:00
|
|
|
export MODULE_DIR=@modulesTree@/lib/modules
|
2007-08-08 21:42:25 +01:00
|
|
|
export NIXPKGS_CONFIG=/nix/etc/config.nix
|
2008-02-07 14:39:32 +00:00
|
|
|
export PAGER="less -R"
|
2007-01-17 12:33:23 +00:00
|
|
|
export TZ=@timeZone@
|
2007-03-29 18:46:36 +01:00
|
|
|
export TZDIR=@glibc@/share/zoneinfo
|
2007-01-17 17:44:57 +00:00
|
|
|
export FONTCONFIG_FILE=/etc/fonts/fonts.conf
|
2007-04-04 14:47:54 +01:00
|
|
|
export LANG=@defaultLocale@
|
2007-04-07 20:29:34 +01:00
|
|
|
export EDITOR=nano
|
2008-01-07 11:46:17 +00:00
|
|
|
export INFOPATH=/var/run/current-system/sw/info:/var/run/current-system/sw/share/info
|
2008-02-01 12:35:51 +00:00
|
|
|
export LOCATE_PATH=/var/cache/locatedb
|
2007-01-15 14:43:56 +00:00
|
|
|
|
2007-03-20 13:50:47 +00:00
|
|
|
|
|
|
|
# A nice prompt.
|
2007-01-15 14:43:56 +00:00
|
|
|
PROMPT_COLOR="1;31m"
|
2008-01-06 18:45:13 +00:00
|
|
|
let $UID && PROMPT_COLOR="1;32m"
|
2007-05-29 20:54:14 +01:00
|
|
|
PS1="\n\[\033[$PROMPT_COLOR\][\u@\h:\w]$\[\033[0m\] "
|
2007-01-15 14:43:56 +00:00
|
|
|
if test "x$TERM" == "xxterm"; then
|
2007-03-13 11:27:15 +00:00
|
|
|
PS1="\033]2;\h:\u:\w\007$PS1"
|
2007-01-15 14:43:56 +00:00
|
|
|
fi
|
|
|
|
|
2007-03-20 13:50:47 +00:00
|
|
|
|
|
|
|
# Set up secure multi-user builds: non-root users build through the
|
|
|
|
# Nix daemon.
|
2007-01-15 14:43:56 +00:00
|
|
|
if test "$USER" != root; then
|
|
|
|
export NIX_REMOTE=daemon
|
2007-03-01 15:31:05 +00:00
|
|
|
else
|
|
|
|
export NIX_REMOTE=
|
2007-01-15 14:43:56 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
|
2007-11-15 17:16:16 +00:00
|
|
|
# Set up the environment variables for running Nix.
|
|
|
|
@nixEnvVars@
|
|
|
|
|
|
|
|
|
2007-01-15 14:43:56 +00:00
|
|
|
# Set up the per-user profile.
|
|
|
|
NIX_USER_PROFILE_DIR=/nix/var/nix/profiles/per-user/$USER
|
|
|
|
mkdir -m 0755 -p $NIX_USER_PROFILE_DIR
|
2007-01-16 13:30:59 +00:00
|
|
|
if test "$(stat --printf '%u' $NIX_USER_PROFILE_DIR)" != "$(id -u)"; then
|
|
|
|
echo "WARNING: bad ownership on $NIX_USER_PROFILE_DIR" >&2
|
2007-01-15 14:43:56 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
if ! test -L $HOME/.nix-profile; then
|
2007-03-20 13:50:47 +00:00
|
|
|
echo "creating $HOME/.nix-profile" >&2
|
|
|
|
if test "$USER" != root; then
|
|
|
|
ln -s $NIX_USER_PROFILE_DIR/profile $HOME/.nix-profile
|
|
|
|
else
|
|
|
|
# Root installs in the system-wide profile by default.
|
|
|
|
ln -s /nix/var/nix/profiles/default $HOME/.nix-profile
|
|
|
|
fi
|
2007-01-15 14:43:56 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
NIX_PROFILES="/nix/var/nix/profiles/default $NIX_USER_PROFILE_DIR/profile"
|
|
|
|
|
|
|
|
for i in $NIX_PROFILES; do # !!! reverse
|
2007-02-12 15:29:43 +00:00
|
|
|
export PATH=$i/bin:$i/sbin:$PATH
|
2008-01-07 11:46:17 +00:00
|
|
|
export INFOPATH=$i/info:$i/share/info:$INFOPATH
|
2008-03-05 19:26:15 +00:00
|
|
|
export PKG_CONFIG_PATH="$i/lib/pkgconfig:$PKG_CONFIG_PATH"
|
2008-03-06 14:56:10 +00:00
|
|
|
export ACLOCAL_PATH="$i/share/aclocal:$ACLOCAL_PATH"
|
2007-01-15 14:43:56 +00:00
|
|
|
done
|
|
|
|
|
2008-02-14 09:41:34 +00:00
|
|
|
# Search directory for Aspell dictionaries.
|
|
|
|
export ASPELL_CONF="dict-dir $NIX_USER_PROFILE_DIR/profile/lib/aspell"
|
|
|
|
|
2007-04-10 15:18:15 +01:00
|
|
|
export PATH=$HOME/bin:$PATH
|
|
|
|
|
2007-01-15 14:43:56 +00:00
|
|
|
|
2007-08-22 15:58:51 +01:00
|
|
|
# Create the per-user garbage collector roots directory.
|
|
|
|
NIX_USER_GCROOTS_DIR=/nix/var/nix/gcroots/per-user/$USER
|
|
|
|
mkdir -m 0755 -p $NIX_USER_GCROOTS_DIR
|
|
|
|
if test "$(stat --printf '%u' $NIX_USER_GCROOTS_DIR)" != "$(id -u)"; then
|
|
|
|
echo "WARNING: bad ownership on $NIX_USER_GCROOTS_DIR" >&2
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
2007-01-15 14:43:56 +00:00
|
|
|
# Set up a default Nix expression from which to install stuff.
|
2007-09-18 16:06:24 +01:00
|
|
|
if test ! -e $HOME/.nix-defexpr -o -L $HOME/.nix-defexpr; then
|
2007-01-15 14:43:56 +00:00
|
|
|
echo "creating $HOME/.nix-defexpr" >&2
|
2007-09-18 16:06:24 +01:00
|
|
|
rm -f $HOME/.nix-defexpr
|
|
|
|
mkdir $HOME/.nix-defexpr
|
2008-01-30 01:28:56 +00:00
|
|
|
ln -s /etc/nixos/nixpkgs $HOME/.nix-defexpr/nixpkgs_sys
|
2007-09-18 16:06:24 +01:00
|
|
|
ln -s /etc/nixos/nixos $HOME/.nix-defexpr/nixos
|
|
|
|
if test "$USER" != root; then
|
|
|
|
ln -s /nix/var/nix/gcroots/per-user/root/channels $HOME/.nix-defexpr/channels_root
|
|
|
|
fi
|
2007-01-15 14:43:56 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
# Some aliases.
|
|
|
|
alias ls="ls --color=tty"
|
|
|
|
alias ll="ls -l"
|
|
|
|
alias which="type -p"
|
|
|
|
|
|
|
|
|
|
|
|
# Read system-wide modifications.
|
|
|
|
if test -f /etc/profile.local; then
|
|
|
|
source /etc/profile.local
|
|
|
|
fi
|