From fe51b0c6c34ffc1186056112bab488434d327d5a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Mon, 10 Aug 2009 10:18:33 +0000 Subject: [PATCH] bashrc: Source `${bash}/etc/bash_completion' when available. svn path=/nixos/trunk/; revision=16641 --- modules/programs/bash/bash.nix | 4 +++- modules/programs/bash/bashrc.sh | 10 ++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/modules/programs/bash/bash.nix b/modules/programs/bash/bash.nix index f7ac48ccb28..38ed7c7a186 100644 --- a/modules/programs/bash/bash.nix +++ b/modules/programs/bash/bash.nix @@ -30,12 +30,14 @@ in # should go into this script. source = pkgs.substituteAll { src = ./bashrc.sh; + + bash = pkgs.bash; systemPath = config.system.path; wrapperDir = config.security.wrapperDir; modulesTree = config.system.modulesTree; shellInit = config.environment.shellInit; }; - target = "bashrc"; + target = "bashrc"; } { # Script executed when the shell starts as a login shell. diff --git a/modules/programs/bash/bashrc.sh b/modules/programs/bash/bashrc.sh index b180d352fdb..b09e3230a5d 100644 --- a/modules/programs/bash/bashrc.sh +++ b/modules/programs/bash/bashrc.sh @@ -61,3 +61,13 @@ alias ll="ls -l" alias l="ls -alh" alias which="type -p" +# Completion. +if [ -d "@bash@/etc/bash_completion.d" ] +then + export BASH_COMPLETION_DIR="@bash@/etc/bash_completion.d" +fi +if [ -f "@bash@/etc/bash_completion" ] +then + export BASH_COMPLETION="@bash@/etc/bash_completion" + source "$BASH_COMPLETION" +fi