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

util-linux look searches for /usr/share/dict/words which does not exist #16545

Closed
vrthra opened this issue Jun 27, 2016 · 9 comments
Closed

util-linux look searches for /usr/share/dict/words which does not exist #16545

vrthra opened this issue Jun 27, 2016 · 9 comments

Comments

@vrthra
Copy link
Member

vrthra commented Jun 27, 2016

Issue description

The look program should look up words in the system dictionary, which either should be present at /usr/share/dict/words or another location.

Steps to reproduce

$ look help
look: /usr/share/dict/words: No such file or directory
zsh: exit 1     look help

Technical details

  • System:

$ nixos-version
16.03.909.f199be0 (Emu)

  • Nix version:

$ nix-env --version
nix-env (Nix) 1.11.2

  • Nixpkgs version:

$ nix-instantiate --eval '' -A lib.nixpkgsVersion
"16.03.909.f199be0"

$ nix-instantiate --eval ~/Development/nixpkgs -A lib.nixpkgsVersion
"16.09pre-git"

@rnhmjoj
Copy link
Contributor

rnhmjoj commented Jul 13, 2016

Is there any package providing the words file?

@vrthra
Copy link
Member Author

vrthra commented Jul 13, 2016

Not sure if a package in Nix provides it. In ubuntu, it is provided thus

@ryantm
Copy link
Member

ryantm commented Feb 24, 2017

It doesn't look like any package is specifically providing it. Maybe we should package the words package as described in the Arch User Repository ( https://git.archlinux.org/svntogit/community.git/tree/trunk/PKGBUILD?h=packages/words ) and add it as a dependency on util-linux

@nixy
Copy link
Contributor

nixy commented Aug 31, 2017

I might take a swing at packaging words but this would also require patching util-linux to make look use the dictionaries from the package. Not sure if I know how that would be done.

@matthewbauer
Copy link
Member

It looks like nixpkgs.scowl provides this list for us. But, I don't think we want to put it in everyone's closure. Instead, I think we can make a NixOS module using the WORDLIST env var

@stale
Copy link

stale bot commented Jun 1, 2020

Thank you for your contributions.
This has been automatically marked as stale because it has had no activity for 180 days.
If this is still important to you, we ask that you leave a comment below. Your comment can be as simple as "still important to me". This lets people see that at least one person still cares about this. Someone will have to do this at most twice a year if there is no other activity.
Here are suggestions that might help resolve this more quickly:

  1. Search for maintainers and people that previously touched the
    related code and @ mention them in a comment.
  2. Ask on the NixOS Discourse. 3. Ask on the #nixos channel on
    irc.freenode.net.

@stale stale bot added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Jun 1, 2020
@mixmixmix
Copy link

still important to me. After installing scowl I can access the list in the store /nix/store/bp5qlbs8fih1p84kxgf0xn87csayjahw-scowl-2019.10.06/share/dict but this is hardly sufficient in the long run.

@stale stale bot removed the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Jul 25, 2021
OmnipotentEntity added a commit to OmnipotentEntity/nixpkgs that referenced this issue Feb 7, 2022
Addresses NixOS#16545.  Allows for user defined environment variables that
hold paths to wordlists.  This is to allow for easy access to wordlists
for users and scripts, (in other distributions a convenient wordlist is
typically found in /usr/share/dict/words or similar).  The default
wordlist is the one found in scowl, for no other reason than that's the
one that was mentioned in the linked issue.

It is possible to specify multiple environment variables as well.  This
is for users who need multiple wordlists (such as multilingual users).
OmnipotentEntity added a commit to OmnipotentEntity/nixpkgs that referenced this issue Feb 9, 2022
Addresses NixOS#16545.  Allows for user defined environment variables that
hold paths to wordlists.  This is to allow for easy access to wordlists
for users and scripts, (in other distributions a convenient wordlist is
typically found in /usr/share/dict/words or similar).  The default
wordlist is the one found in scowl, for no other reason than that's the
one that was mentioned in the linked issue.

It is possible to specify multiple environment variables as well.  This
is for users who need multiple wordlists (such as multilingual users).
@OmnipotentEntity
Copy link
Contributor

It seems like my PR is in the final stages of review. If anyone has any good suggestions for it, please let me know!

@OmnipotentEntity
Copy link
Contributor

#158034 has been merged 🥳

To use it simply set environment.wordlist.enable = true in your configuration.nix. The default is sane. It sets the $WORDLIST variable (which is used by look by default) to the default wordlist in the scowl package, which as mentioned upthread is the wordlist package used in many popular distributions by default.

As far as I am aware, this is everything needed to finally put this issue to bed, so I'm going to close this issue. Special thanks to @pennae and the rest of the folken in the NixOS Dev Matrix Chat for guiding me through the process of making my first module. Thanks to @rissson for giving me a review. And thanks @Synthetica9 for the merge.

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

No branches or pull requests

7 participants