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

coursier #24

Open
cquiroz opened this issue Mar 1, 2022 · 6 comments
Open

coursier #24

cquiroz opened this issue Mar 1, 2022 · 6 comments

Comments

@cquiroz
Copy link

cquiroz commented Mar 1, 2022

Another newbie question.
In a new laptop using typelevel-nix I was able to build my code but to use metals I had to install coursier as an extra package
I'm not sure if it should be included here as it seems to be a one-time install. WDYT?

@rossabaker
Copy link
Member

My editor finds metals on the $PATH, and the right one is on the path because of direnv. I don't have a global metals install -- it's all self-contained, with no coursier install.

If your editor isn't hooked into direnv, you would probably have to have a global metals install? You could probably do that with home-manager, but I think a global one would be outside the scope of a dev shell.

@cquiroz
Copy link
Author

cquiroz commented Mar 2, 2022

I'm using direnv but on starting the editor it complained metals wasn't installed. I'll keep researching this

@vincenzobaz
Copy link

@cquiroz did you find a solution?
Can you guys point to a tutorial or give me some hints on how to configure direnv with this flake?

@armanbilge
Copy link
Member

@vincenzobaz I don't use direnv, but I understand you need to add an .envrc file like this to your repository and explicitly direnv allow for that folder.
https://github.com/typelevel/cats-effect/blob/7e24bb96d4921f4bb50bf439c3429bcff998f457/.envrc

@rossabaker
Copy link
Member

My setup behaves like this:

$ cd ~
$ which metals
metals not found
$ cd ~/src/http4s
direnv: loading ~/src/http4s/.envrc
direnv: using flake
🔨 Welcome to http4s

[general commands]

  menu      - prints this menu
  metals    - Work-in-progress language server for Scala
  sbt       - A build tool for Scala, Java and more
  scala-cli - Command-line tool to interact with the Scala language

[versions]

  Java - 8.0.292
  Node - 18.15.0

direnv: export +C_INCLUDE_PATH +DEVSHELL_DIR +IN_NIX_SHELL +JAVA_HOME +LIBRARY_PATH +LLVM_BIN +NIXPKGS_PATH +PRJ_DATA_DIR +PRJ_ROOT +name -TMPDIR ~PATH ~XDG_DATA_DIRS
$ which metals
/nix/store/63xf0hwwwqysdk5cx1mzd0ng30y8g0j1-devshell-dir/bin/metals

.envrc is just:

use flake

And yes, every new project you need to do a direnv allow, because direnv can execute nasty things, and you wouldn't want it on a project you don't trust.

@vincenzobaz
Copy link

I managed to get it working. Thank you both for the input

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

4 participants