claymager / idris2-pkgs

An unofficial Idris2 package repository for Nix
MIT License
46 stars 13 forks source link

Document how to get nix develop with lsp installed #5

Closed 3noch closed 3 years ago

3noch commented 3 years ago

I'm very new to nix flakes and I'm struggling to find out how I might have a shell where idris2-lsp is available for my IDE.

3noch commented 3 years ago

Adding this to flake.nix seems to work:

        devShell = pkgs.mkShell {
          buildInputs = [ pkgs.idris2.packages.lsp ];
          buildInputsFrom = [ mypkg ];
        };
claymager commented 3 years ago

Do you have some other overlay active? I can't find buildInputsFrom, but it looks useful.

I've started using something like this, but I'm still not quite happy with it:

{
  devShell = pkgs.mkShell {
    buildInputs = [
      (pkgs.idris2.packages.lsp.withPackages (p: mypkg.idrisLibraries))
    ];
  };
}
3noch commented 3 years ago

I mistyped. It's actually inputsFrom: https://nixos.org/manual/nixpkgs/stable/#sec-pkgs-mkShell

claymager commented 3 years ago

Current approach, as in the new project tutorial, is to use

{
  buildInputs = [ (idris2-pkgs._builders.devEnv mypkg) ];
}