Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set aspell's data-dir through ASPELL_CONF in a wrapper #24425

Merged
merged 1 commit into from Apr 19, 2017
Merged

Set aspell's data-dir through ASPELL_CONF in a wrapper #24425

merged 1 commit into from Apr 19, 2017

Conversation

lpenz
Copy link
Contributor

@lpenz lpenz commented Mar 28, 2017

This makes aspell find the dictionaries in the
user directory, and is essentially what the
documentation suggested.

See #1000

Motivation for this change

#1000

Things done
  • Tested using sandboxing
    (nix.useSandbox on NixOS,
    or option build-use-sandbox in nix.conf
    on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • Linux
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Fits CONTRIBUTING.md.

@bjornfor
Copy link
Contributor

This only allows installing dicts with nix-env :-/ I have them in configuration.nix, so that will break for me. Is there no other way to fix this for non-NixOS users?

Has anyone looked into making aspell take a list of dict-dirs?

@lpenz
Copy link
Contributor Author

lpenz commented Mar 29, 2017

How about an option to set ASPELL_CONF only if it's not set?
(in no way implying that I would know how to do that...)

@bjornfor
Copy link
Contributor

How about an option to set ASPELL_CONF only if it's not set?

Sounds good to me.

@lpenz
Copy link
Contributor Author

lpenz commented Apr 1, 2017

Done!

@bjornfor
Copy link
Contributor

bjornfor commented Apr 1, 2017

If you want to change makeWrapper I think it should be in a separate commit. Perhaps even separate PR, for visibility. It's a mass rebuild so it'd have to go via the staging branch.

I don't think the need for a --default option in makeWrapper has come up before, so the question is whether this is something we generally need. Do you think there will be other users than "aspell"?

Since you're adding a wrapper... how about writing a custom wrapper for aspell which iterates over $NIX_PROFILES and sets $ASPELL_CONF accordingly (like NixOS does)? Benefits: works no matter how aspell was installed and we can get rid of the ASPELL_CONF logic in NixOS.

Hmm, I see $NIX_PROFILES isn't set in my Ubuntu+Nix. Is it set on macOS? One could hardcode the profile paths in the wrapper until the profile scripts on all platforms set $NIX_PROFILES.

@lpenz
Copy link
Contributor Author

lpenz commented Apr 2, 2017

Sounds better! I will try that.

@lpenz
Copy link
Contributor Author

lpenz commented Apr 9, 2017

I'm not very confident that this Is this what you mean. If it is not, could you direct me to an example?

@bjornfor
Copy link
Contributor

bjornfor commented Apr 9, 2017

Yes, that's what I had in mind :-)

Did you test it?

Please prefix commit message with "aspell:".

if the user didn't set ASPELL_CONF, use it to point to the dictionary
location by first looking at NIX_PROFILE directories and then using
$HOME/.nix-profile.

See #1000
@lpenz
Copy link
Contributor Author

lpenz commented Apr 10, 2017

Cool!
Commit message updated.
I tested it with nix-env and inside the nixos/nix docker image that os docker hub - although I think they have the same behaviour - i.e. no $NIX_PROFILES

@bennofs
Copy link
Contributor

bennofs commented Apr 19, 2017

Looks good to me.

@bennofs bennofs merged commit 792135a into NixOS:master Apr 19, 2017
@lpenz lpenz deleted the aspellconf branch April 21, 2017 19:26
@FRidh FRidh mentioned this pull request Jun 16, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants