2009-05-28 22:02:47 +00:00
|
|
|
if [ -n "$NOSYSBASHRC" ]; then
|
2009-06-26 11:36:38 +00:00
|
|
|
return
|
2009-05-28 22:02:47 +00:00
|
|
|
fi
|
2009-06-26 11:36:38 +00:00
|
|
|
|
2011-02-08 14:58:41 +00:00
|
|
|
# In interactive shells, check the window size after every command.
|
|
|
|
if [ -n "$PS1" ]; then
|
|
|
|
shopt -s checkwinsize
|
|
|
|
fi
|
|
|
|
|
2008-07-16 16:01:09 +00:00
|
|
|
# Initialise a bunch of environment variables.
|
2010-05-30 22:00:52 +00:00
|
|
|
export LD_LIBRARY_PATH=/var/run/opengl-driver/lib:/var/run/opengl-driver-32/lib # !!! only set if needed
|
2008-07-16 16:01:09 +00:00
|
|
|
export MODULE_DIR=@modulesTree@/lib/modules
|
|
|
|
export NIXPKGS_CONFIG=/nix/etc/config.nix
|
2008-07-23 16:06:03 +00:00
|
|
|
export NIXPKGS_ALL=/etc/nixos/nixpkgs
|
2008-07-16 16:01:09 +00:00
|
|
|
export PAGER="less -R"
|
|
|
|
export EDITOR=nano
|
|
|
|
export LOCATE_PATH=/var/cache/locatedb
|
|
|
|
|
|
|
|
|
|
|
|
# Include the various profiles in the appropriate environment variables.
|
|
|
|
NIX_USER_PROFILE_DIR=/nix/var/nix/profiles/per-user/$USER
|
|
|
|
|
2010-09-19 00:21:30 +00:00
|
|
|
NIX_PROFILES="/var/run/current-system/sw /nix/var/nix/profiles/default $HOME/.nix-profile"
|
2010-04-15 15:47:15 +00:00
|
|
|
|
2010-10-25 01:46:30 +00:00
|
|
|
unset PATH INFOPATH PKG_CONFIG_PATH PERL5LIB ALSA_PLUGIN_DIRS GST_PLUGIN_PATH KDEDIRS
|
2010-10-25 16:44:21 +00:00
|
|
|
unset QT_PLUGIN_PATH QTWEBKIT_PLUGIN_PATH STRIGI_PLUGIN_PATH XDG_CONFIG_DIRS XDG_DATA_DIRS
|
2008-07-16 16:01:09 +00:00
|
|
|
|
|
|
|
for i in $NIX_PROFILES; do # !!! reverse
|
2010-05-17 14:15:18 +00:00
|
|
|
# We have to care not leaving an empty PATH element, because that means '.' to Linux
|
2010-09-30 05:08:33 +00:00
|
|
|
export PATH=$i/bin:$i/sbin:$i/lib/kde4/libexec${PATH:+:}$PATH
|
2010-05-17 14:15:18 +00:00
|
|
|
export INFOPATH=$i/info:$i/share/info${INFOPATH:+:}$INFOPATH
|
|
|
|
export PKG_CONFIG_PATH="$i/lib/pkgconfig${PKG_CONFIG_PATH:+:}$PKG_CONFIG_PATH"
|
2008-10-09 19:58:11 +00:00
|
|
|
|
2009-05-15 07:55:47 +00:00
|
|
|
# "lib/site_perl" is for backwards compatibility with packages
|
|
|
|
# from Nixpkgs <= 0.12.
|
2010-05-17 14:15:18 +00:00
|
|
|
export PERL5LIB="$i/lib/perl5/site_perl:$i/lib/site_perl${PERL5LIB:+:}$PERL5LIB"
|
2008-11-11 17:08:04 +00:00
|
|
|
|
2010-09-26 03:49:33 +00:00
|
|
|
# ALSA plugins
|
|
|
|
export ALSA_PLUGIN_DIRS="$i/lib/alsa-lib${ALSA_PLUGIN_DIRS:+:}$ALSA_PLUGIN_DIRS"
|
|
|
|
|
2008-11-11 17:08:04 +00:00
|
|
|
# GStreamer.
|
2010-05-17 14:15:18 +00:00
|
|
|
export GST_PLUGIN_PATH="$i/lib/gstreamer-0.10${GST_PLUGIN_PATH:+:}$GST_PLUGIN_PATH"
|
2009-02-20 16:31:42 +00:00
|
|
|
|
|
|
|
# KDE/Gnome stuff.
|
2010-05-17 14:15:18 +00:00
|
|
|
export KDEDIRS=$i${KDEDIRS:+:}$KDEDIRS
|
2010-10-25 01:46:30 +00:00
|
|
|
export STRIGI_PLUGIN_PATH=$i/lib/strigi/${STRIGI_PLUGIN_PATH:+:}$STRIGI_PLUGIN_PATH
|
2010-09-20 14:10:46 +00:00
|
|
|
export QT_PLUGIN_PATH=$i/lib/qt4/plugins:$i/lib/kde4/plugins${QT_PLUGIN_PATH:+:}$QT_PLUGIN_PATH
|
2010-10-25 16:44:21 +00:00
|
|
|
export QTWEBKIT_PLUGIN_PATH=$i/lib/mozilla/plugins/${QTWEBKIT_PLUGIN_PATH:+:}$QTWEBKIT_PLUGIN_PATH
|
2010-05-17 14:15:18 +00:00
|
|
|
export XDG_CONFIG_DIRS=$i/etc/xdg${XDG_CONFIG_DIRS:+:}$XDG_CONFIG_DIRS
|
|
|
|
export XDG_DATA_DIRS=$i/share${XDG_DATA_DIRS:+:}$XDG_DATA_DIRS
|
2008-07-16 16:01:09 +00:00
|
|
|
done
|
2010-04-15 15:47:15 +00:00
|
|
|
@shellInit@
|
2008-07-16 16:01:09 +00:00
|
|
|
|
|
|
|
|
|
|
|
# Search directory for Aspell dictionaries.
|
2010-09-19 00:21:30 +00:00
|
|
|
export ASPELL_CONF="dict-dir $HOME/.nix-profile/lib/aspell"
|
2008-07-16 16:01:09 +00:00
|
|
|
|
|
|
|
|
|
|
|
# ~/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
|
2010-10-30 20:40:33 +00:00
|
|
|
PS1="\[\033]2;\h:\u:\w\007\]$PS1"
|
2008-07-16 16:01:09 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
# Some aliases.
|
|
|
|
alias ls="ls --color=tty"
|
|
|
|
alias ll="ls -l"
|
|
|
|
alias l="ls -alh"
|
2010-11-26 09:57:38 +00:00
|
|
|
alias which="type -P"
|
2008-07-16 16:01:09 +00:00
|
|
|
|
2010-02-13 00:07:12 +00:00
|
|
|
# The "non-interactive" Bash build does not support programmable
|
|
|
|
# completion so check whether it's available.
|
2010-02-22 17:20:12 +00:00
|
|
|
if false; then
|
|
|
|
#if shopt -q progcomp 2> /dev/null; then
|
2010-02-13 00:07:12 +00:00
|
|
|
# Completion.
|
|
|
|
if [ -z "$BASH_COMPLETION_DIR" -a -d "@bash@/etc/bash_completion.d" ]; then
|
|
|
|
BASH_COMPLETION_DIR="@bash@/etc/bash_completion.d"
|
|
|
|
fi
|
|
|
|
if [ -z "$BASH_COMPLETION" -a -f "@bash@/etc/bash_completion" ]; then
|
|
|
|
BASH_COMPLETION="@bash@/etc/bash_completion"
|
|
|
|
source "$BASH_COMPLETION"
|
|
|
|
fi
|
|
|
|
fi
|