Skip to content

Commit

Permalink
aspell: only set ASPELL_CONF from NIX_PROFILES in wrapper if unset
Browse files Browse the repository at this point in the history
  • Loading branch information
bennofs committed Apr 19, 2017
1 parent 792135a commit 399065f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkgs/development/libraries/aspell/default.nix
Expand Up @@ -31,7 +31,7 @@ stdenv.mkDerivation rec {
#! $SHELL -e
if [ -z "\$ASPELL_CONF" ]; then
for p in \$NIX_PROFILES; do
if [ -d "\$p/lib/aspell" ]; then
if [ -z "\$ASPELL_CONF" ] && [ -d "\$p/lib/aspell" ]; then
ASPELL_CONF="data-dir \$p/lib/aspell"
fi
done
Expand Down

3 comments on commit 399065f

@bjornfor
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't test it, but I think the logic was correct as it was. Now I think ASPELL_CONF will point to the first possible entry in $NIX_PROFILES, whereas we want it to point to the last. Reasoning being that if aspell is installed with nix-env -i ... then that should take priority over the system installed version.

Also, the commit message confuses me. Didn't the previous code also "only set ASPELL_CONF from NIX_PROFILES in wrapper if unset"?. (There is already a check for empty ASPELL_CONF above.)

@bennofs
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ugh, I don't know how I missed that check for empty aspell above... I will revert this commit. I didn't know that NIX_PROFILES was supposed to have any guarranted order.

@bjornfor
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know if it's written down anywhere (the order of $NIX_PROFILES). I'm just guessing :-)

Please sign in to comment.