From 0192c027203efa9b7b4d6516d8d5ae322e76c6bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Forsman?= Date: Sat, 14 Sep 2013 13:05:11 +0200 Subject: [PATCH] /etc/profile: try all nix profiles for ASPELL_CONF Aspell can only handle one dict-dir directive and currently we hardocde that to ASPELL_CONF="dict-dir $HOME/.nix-profile/lib/aspell" This means that aspell doesn't work if it is installed to the system or default nix profile -- it only works in the user profile. With this change, aspell can be installed to any of the nix profiles. If it is installed in more than one profile, the most "local" profile wins (i.e. sysadmin can set up a default, users can override it). --- modules/programs/bash/profile.sh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/modules/programs/bash/profile.sh b/modules/programs/bash/profile.sh index 6bcd5cd87cd..92fb0658189 100644 --- a/modules/programs/bash/profile.sh +++ b/modules/programs/bash/profile.sh @@ -56,10 +56,12 @@ for i in $NIX_PROFILES; do # !!! reverse # Mozilla plugins. export MOZ_PLUGIN_PATH=$i/lib/mozilla/plugins${MOZ_PLUGIN_PATH:+:}$MOZ_PLUGIN_PATH -done -# Search directory for Aspell dictionaries. -export ASPELL_CONF="dict-dir $HOME/.nix-profile/lib/aspell" + # Search directory for Aspell dictionaries. + if [ -d "$i/lib/aspell" ]; then + export ASPELL_CONF="dict-dir $i/lib/aspell" + fi +done # The setuid wrappers override other bin directories. export PATH=@wrapperDir@:$PATH