2008-07-16 17:01:09 +01:00
|
|
|
# Initialise a bunch of environment variables.
|
|
|
|
export PATH=/var/run/current-system/sw/bin:/var/run/current-system/sw/sbin
|
|
|
|
export LD_LIBRARY_PATH=/var/run/opengl-driver/lib
|
|
|
|
if test -n "@nssModulesPath@"; then
|
|
|
|
LD_LIBRARY_PATH=@nssModulesPath@:$LD_LIBRARY_PATH
|
|
|
|
fi
|
|
|
|
export MODULE_DIR=@modulesTree@/lib/modules
|
|
|
|
export NIXPKGS_CONFIG=/nix/etc/config.nix
|
2008-07-23 17:06:03 +01:00
|
|
|
export NIXPKGS_ALL=/etc/nixos/nixpkgs
|
2008-07-16 17:01:09 +01:00
|
|
|
export PAGER="less -R"
|
|
|
|
export TZ=@timeZone@
|
|
|
|
export TZDIR=@glibc@/share/zoneinfo
|
|
|
|
export FONTCONFIG_FILE=/etc/fonts/fonts.conf
|
|
|
|
export LANG=@defaultLocale@
|
|
|
|
export EDITOR=nano
|
|
|
|
export INFOPATH=/var/run/current-system/sw/info:/var/run/current-system/sw/share/info
|
|
|
|
export LOCATE_PATH=/var/cache/locatedb
|
2009-04-11 23:12:02 +01:00
|
|
|
@shellInit@
|
2009-04-28 14:42:43 +01:00
|
|
|
export LOCALE_ARCHIVE=/var/run/current-system/sw/lib/locale/locale-archive
|
2008-07-16 17:01:09 +01:00
|
|
|
|
|
|
|
# Set up secure multi-user builds: non-root users build through the
|
|
|
|
# Nix daemon.
|
|
|
|
if test "$USER" != root; then
|
|
|
|
export NIX_REMOTE=daemon
|
|
|
|
else
|
|
|
|
export NIX_REMOTE=
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
# Set up the environment variables for running Nix.
|
|
|
|
@nixEnvVars@
|
|
|
|
|
|
|
|
|
|
|
|
# Include the various profiles in the appropriate environment variables.
|
|
|
|
NIX_USER_PROFILE_DIR=/nix/var/nix/profiles/per-user/$USER
|
|
|
|
|
|
|
|
NIX_PROFILES="/nix/var/nix/profiles/default $NIX_USER_PROFILE_DIR/profile"
|
|
|
|
|
|
|
|
for i in $NIX_PROFILES; do # !!! reverse
|
|
|
|
export PATH=$i/bin:$i/sbin:$PATH
|
|
|
|
export INFOPATH=$i/info:$i/share/info:$INFOPATH
|
|
|
|
export PKG_CONFIG_PATH="$i/lib/pkgconfig:$PKG_CONFIG_PATH"
|
2008-10-09 20:58:11 +01:00
|
|
|
|
|
|
|
# Automake's `aclocal' bails out if it finds non-existent directories
|
2009-04-05 19:30:39 +01:00
|
|
|
# in its path. !!! This has been fixed in the stdenv branch.
|
|
|
|
if [ -d "$i/share/aclocal" ]; then
|
2009-04-11 23:12:02 +01:00
|
|
|
export ACLOCAL_PATH="$i/share/aclocal:$ACLOCAL_PATH"
|
2008-10-09 20:58:11 +01:00
|
|
|
fi
|
2009-04-11 23:12:02 +01:00
|
|
|
|
2009-05-15 08:55:47 +01:00
|
|
|
# "lib/site_perl" is for backwards compatibility with packages
|
|
|
|
# from Nixpkgs <= 0.12.
|
|
|
|
export PERL5LIB="$i/lib/perl5/site_perl:$i/lib/site_perl:$PERL5LIB"
|
2008-11-11 17:08:04 +00:00
|
|
|
|
|
|
|
# GStreamer.
|
|
|
|
export GST_PLUGIN_PATH="$i/lib/gstreamer-0.10:$GST_PLUGIN_PATH"
|
2009-02-20 16:31:42 +00:00
|
|
|
|
|
|
|
# KDE/Gnome stuff.
|
|
|
|
export KDEDIRS=$i:$KDEDIRS
|
|
|
|
export XDG_CONFIG_DIRS=$i/etc/xdg:$XDG_CONFIG_DIRS
|
|
|
|
export XDG_DATA_DIRS=$i/share:$XDG_DATA_DIRS
|
2008-07-16 17:01:09 +01:00
|
|
|
done
|
|
|
|
|
|
|
|
|
|
|
|
# Search directory for Aspell dictionaries.
|
|
|
|
export ASPELL_CONF="dict-dir $NIX_USER_PROFILE_DIR/profile/lib/aspell"
|
|
|
|
|
|
|
|
|
|
|
|
# ~/bin and the setuid wrappers override other bin directories.
|
|
|
|
export PATH=$HOME/bin:@wrapperDir@:$PATH
|
|
|
|
|
|
|
|
|
|
|
|
# Provide a nice prompt.
|
|
|
|
PROMPT_COLOR="1;31m"
|
|
|
|
let $UID && PROMPT_COLOR="1;32m"
|
|
|
|
PS1="\n\[\033[$PROMPT_COLOR\][\u@\h:\w]\\$\[\033[0m\] "
|
|
|
|
if test "$TERM" = "xterm"; then
|
|
|
|
PS1="\033]2;\h:\u:\w\007$PS1"
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
# Some aliases.
|
|
|
|
alias ls="ls --color=tty"
|
|
|
|
alias ll="ls -l"
|
|
|
|
alias l="ls -alh"
|
|
|
|
alias which="type -p"
|
|
|
|
|
|
|
|
|
|
|
|
# Help `rpcgen' find `cpp', assuming it's installed in the user's environment.
|
|
|
|
alias rpcgen="rpcgen -Y $HOME/.nix-profile/bin"
|