From 9ffb0e8ec4036b064f1d78138400f2f30f60c627 Mon Sep 17 00:00:00 2001 From: Sander van der Burg Date: Wed, 12 Mar 2008 10:18:11 +0000 Subject: [PATCH] Added bashrc files to make dircolors/prompt working on xterm/konsole etc. svn path=/nixos/trunk/; revision=11072 --- etc/default.nix | 14 +++++++++++--- etc/profile.sh | 19 ++----------------- 2 files changed, 13 insertions(+), 20 deletions(-) diff --git a/etc/default.nix b/etc/default.nix index 0286517927a..bcd8b57fe58 100644 --- a/etc/default.nix +++ b/etc/default.nix @@ -32,7 +32,6 @@ import ../helpers/make-etc.nix { inherit (pkgs) stdenv; configFiles = [ - { # TCP/UDP port assignments. source = pkgs.iana_etc + "/etc/services"; target = "services"; @@ -104,7 +103,12 @@ import ../helpers/make-etc.nix { target = "dhclient-exit-hooks"; } - { # Script executed when the shell starts. + { # Script executed when the shell starts as a non-login shell (system-wide version). + source = ./bashrc; + target = "bashrc"; + } + + { # Script executed when the shell starts as a login shell. source = pkgs.substituteAll { src = ./profile.sh; inherit systemPath wrapperDir modulesTree; @@ -133,6 +137,11 @@ import ../helpers/make-etc.nix { target = "nix.conf"; # will be symlinked from /nix/etc/nix/nix.conf in activate-configuration.sh. } + { # Script executed when the shell starts as a non-login shell (user version). + source = ./skel/bashrc; + target = "skel/.bashrc"; + } + { # SSH configuration. Slight duplication of the sshd_config # generation in the sshd service. source = pkgs.writeText "ssh_config" '' @@ -145,7 +154,6 @@ import ../helpers/make-etc.nix { ''; target = "ssh/ssh_config"; } - ] # Configuration for ssmtp. diff --git a/etc/profile.sh b/etc/profile.sh index c88d6e83f9b..9f98d4f7461 100644 --- a/etc/profile.sh +++ b/etc/profile.sh @@ -11,15 +11,6 @@ export INFOPATH=/var/run/current-system/sw/info:/var/run/current-system/sw/share export LOCATE_PATH=/var/cache/locatedb -# 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 "x$TERM" == "xxterm"; then - PS1="\033]2;\h:\u:\w\007$PS1" -fi - - # Set up secure multi-user builds: non-root users build through the # Nix daemon. if test "$USER" != root; then @@ -85,15 +76,9 @@ if test ! -e $HOME/.nix-defexpr -o -L $HOME/.nix-defexpr; then fi fi +# Include bashrc settings -# Some aliases. -alias ls="ls --color=tty" -alias ll="ls -l" -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" - +source /etc/bashrc # Read system-wide modifications. if test -f /etc/profile.local; then