basedpyright icon indicating copy to clipboard operation
basedpyright copied to clipboard

NixOS Support

Open znd4 opened this issue 1 year ago • 9 comments

The bundled node fails to run on NixOS:

Could not start dynamically linked executable: /home/znd4/Projects/far.ai-interview/.direnv/python-3.11/lib/python3.11/site-packages/nodejs/bin/node
NixOS cannot run dynamically linked executables intended for generic\nlinux environments out of the box. For more information, see:
https://nix.dev/permalink/stub-ld

I'd understand closing this issue, but I thought I'd at least leave some breadcrumbs for future me / anyone else who wants to take a crack at packaging this really cool looking project for Nix:

Unfortunately, my node experience is pretty thin, so this might be tricky

znd4 avatar Mar 20 '24 22:03 znd4

can you please check if #323 fixes this?

pip install git+https://github.com/DetachHead/basedpyright@fa71759782c1d3b97eae50504711d670739208d7

(note that it will probably take several minutes to install due to #335)

DetachHead avatar May 03 '24 23:05 DetachHead

By now I'm using https://github.com/leiserfg/leiserfg-overlay/blob/master/pkgs/basedpyright/default.nix

leiserfg avatar May 06 '24 07:05 leiserfg

so that just patches it to use a different node binary. i don't know anything about nix but is it a problem with the node binary we're using that can be raised upstream at https://github.com/njzjz/nodejs-wheel?

DetachHead avatar May 08 '24 02:05 DetachHead

In nixos libraries are not stored in the same path, so to make the regular node work I will need to patch the binary. That is doable but at that point I better replace it (as I did), which brings the plus of avoiding having another nodejs instead.

leiserfg avatar May 08 '24 05:05 leiserfg

do you think that's a decent solution? we can add a "nixOS" section in the installation instructions that says to install it from your repo

DetachHead avatar May 08 '24 06:05 DetachHead

I could add a flake to your repo if you like so, but it will have to be in the weekend.

leiserfg avatar May 08 '24 11:05 leiserfg

sounds good, thanks

DetachHead avatar May 08 '24 13:05 DetachHead

FWIW I have an open PR to bring basedpyright into nixpkgs based on the pyright package. nixos/nixpkgs#308503

kiike avatar May 09 '24 08:05 kiike

@DetachHead then it's better to wait for the work from @kiike to be merged.

leiserfg avatar May 09 '24 21:05 leiserfg

FYI, my PR, which brings basedpyright into NixOS, was merged four days ago. I guess it is already in the nixos-unstable repo, but probably won't have made it in time for the 24.05 release.

kiike avatar May 28 '24 15:05 kiike

thanks! if you don't mind would you like to also write some installation instructions for nixOS?

DetachHead avatar May 28 '24 21:05 DetachHead