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

Configure nix/node/ruby/python/go/lua pkg managers to install to $HOME #20

Closed
5 of 6 tasks
lrvick opened this issue Feb 5, 2016 · 14 comments
Closed
5 of 6 tasks

Comments

@lrvick
Copy link
Member

lrvick commented Feb 5, 2016

  • nix
  • node
  • ruby
  • python
  • go
  • lua
@lrvick lrvick changed the title Configure node/ruby/python/go/lua pkg managers to install to $HOME Configure nix/node/ruby/python/go/lua pkg managers to install to $HOME Feb 5, 2016
@gmcclins
Copy link
Contributor

gmcclins commented Mar 7, 2016

as far as node is this what you are looking for

NPM_PACKAGES="$HOME/.npm-packages"
mkdir -p "$NPM_PACKAGES" # Useless; this is created automatically
echo "prefix = $NPM_PACKAGES" >> ~/.npmrc

and then configure path in zshrc/.bashrc:

NPM packages in homedir

NPM_PACKAGES="$HOME/.npm-packages" # We need a way to set this automatically

Tell our environment about user-installed node tools

PATH="$NPM_PACKAGES/bin:$PATH" # Same with this

Unset manpath so we can inherit from /etc/manpath via the manpath command

unset MANPATH
MANPATH="$NPM_PACKAGES/share/man:$(manpath)"

i'm not sure about the manpath stuff

Tell Node about these packages

NODE_PATH="$NPM_PACKAGES/lib/node_modules:$NODE_PATH"

Now when you do an npm install -g, NPM will install the libraries into ~/.npm-packages/lib/node_modules, and link executable tools into ~/.npm-packages/bin, which is in your PATH.

Credit: source

Seems to work well on my end as should

@RyanSquared
Copy link
Member

LuaRocks installs to ~/.luarocks and I'm working on a /etc/profile.d patch to make Lua automatically support this.

Also, shouldn't we try doing this in shell-etc to make it system configuration instead of dotfiles? This is what caused the problem with Mutt previously.

@daurnimator
Copy link
Member

LuaRocks installs to ~/.luarocks and I'm working on a /etc/profile.d patch to make Lua automatically support this.

Merged via hashbang/shell-etc#78

Also, shouldn't we try doing this in shell-etc to make it system configuration instead of dotfiles? This is what caused the problem with Mutt previously.

Yep. this will allow users to override in their own dotfiles.

@RyanSquared
Copy link
Member

Unfortunately by default either you have to install npm packages as a pseudo-global package; just running npm install downloads the package and places it in the current directory - this is nice, but not when it comes to per-user libraries and applications. I'm going to work on getting @gmcclins's setup working on a dev server before I approve it for here.

@RyanSquared
Copy link
Member

RyanSquared commented Oct 3, 2016

So we tested on the shell servers last night and it looks like Ruby is configured to do this automatically. \o/ @hashbang/administrators please double check (just install something with gem) so we can cross that off.

@RyanSquared
Copy link
Member

@hashbang/administrators can someone install libruby-dev and check the above?

@KellerFuchs
Copy link
Member

@ChickenNuggers Not entirely sure why you needed someone else to test it for you, but:

kellertest@da1:~$ gem install lolcat
Fetching: paint-1.0.1.gem (100%)
Successfully installed paint-1.0.1
Fetching: trollop-2.1.2.gem (100%)
Successfully installed trollop-2.1.2
Fetching: lolcat-42.1.43.gem (100%)
Successfully installed lolcat-42.1.43
Parsing documentation for lolcat-42.1.43
Installing ri documentation for lolcat-42.1.43
Parsing documentation for paint-1.0.1
Installing ri documentation for paint-1.0.1
Parsing documentation for trollop-2.1.2
Installing ri documentation for trollop-2.1.2
Done installing documentation for lolcat, paint, trollop after 1 seconds
3 gems installed

kellertest@da1:~$ ls -Al `which lolcat`
-rwx------ 1 kellertest kellertest 492 Oct 29 01:39 /home/kellertest/.gem/bin/lolcat

@RyanSquared
Copy link
Member

Well I finally found where the .gem/bin was added due to something unrelated (Debian sucks, Node sucks, JavaScript sucks, burn it all) and wasn't sure if I set it or not. Adding to done list.

@RyanSquared
Copy link
Member

RyanSquared commented Oct 29, 2016

node will be fixed with #114

@RyanSquared
Copy link
Member

RyanSquared commented Oct 29, 2016

go will be fixed with #115

@RyanSquared
Copy link
Member

nix should be fixed with #116

@RyanSquared
Copy link
Member

RyanSquared commented Oct 29, 2016

python will be fixed with #117

@RyanSquared
Copy link
Member

waiting on hashbang/shell-etc#136 for Node. might do Nix later.

@RyanSquared
Copy link
Member

Closing. This exists in /etc/profile.d

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants