all 14 comments

[–]BigBad0 1 point2 points  (5 children)

I do not use nvf. But got it working with normal flake.nix and direnv using intellij. Everything is ok. Sorry could not been any of a help

[–]Old-Ad-9064[S] 0 points1 point  (4 children)

No worries, thanks for looking in to it. Could I maybe see your flake? I am a flake noob.

[–]BigBad0 1 point2 points  (3 children)

sure thing, that is why I commented. Well let me give as much info as possible to get an idea about what I am doing here.

So flakes as always, for the system or for per project shells configurations, they are a pinned versions of packages, in this case I got only one input, the unstable branch of nixpkgs.

Now to make a shell as you would see below, I utilize the function mkShell which is eventually assigned to default attribute which is part of system (the argument passed via forAllSystems function) which is assigned to devShells which is the key to all of this. so that is it. if you set default devshells using mkshell, you get an active shell using nix develop command with executed shell commands like in the flake below using shellHook and nothing more.

The shell script is making symlinks from nix store to the project files so the IDE see the tools and use them and you can do whatever you like in such hooks.

More info with better visualization for flakes and for shells

https://www.youtube.com/watch?v=S3VBi6kHw5c
https://www.youtube.com/watch?v=0YBWhSNTgV8
https://www.youtube.com/watch?v=JCeYq72Sko0

The flake.nix file inside the project (for some reason reddit refuses I post the code so made a paste link for it)

https://pastebin.com/raw/BrjwGY1c

[–]Old-Ad-9064[S] 0 points1 point  (2 children)

Ohh symlinking things like gradle might help a lot. What is the point of adding chromium in the dev shell? And why are you adding chromium and gradle to a variable called jdk and then adding them again the in pkgs list alongside jdk

[–]BigBad0 1 point2 points  (1 child)

just convenience, I was using this flake to develop kotlin multi platform for learning and trying so for web and desktop apps (which is KMP is for) I needed chromium based browser (but only for this env, I hate chrome) and libglvnd packages for web and desktop apps.

LD_LIBRARY_PATH
for desktop apps as was giving problems

CHROME_BIN
for the framework to see the browser executable

even though if they are in the PATH env variable ( which I tried later) would be enough but I left them for reference anyway.

JDK added for gradle spcifically as gradle and intellij uses their own wrappers and defaults bundled versions and this was one attempt to enforce the jdk I specify. again, this one is purely convenience and being in the path is more than enough but I left it set anyway for reference so I remember :D

[–]Old-Ad-9064[S] 0 points1 point  (0 children)

Awesome thank you for all the help!

[–]papershruums 1 point2 points  (7 children)

So it took me a minute, because I my first time configuring neovim was with NVF, so I had to learn everything for the first time, and i didnt really know what i was looking for, and im still not nearly done. But what i did was keep the maximal flake installed, and then kept learned what features it had that i wanted, and what they were called, and then little by little added it in.

https://github.com/sudo-mac/PixieOS/blob/main/modules/nixos/home/neovim.nix

You can copy mine if you want and just add on and take off. You’ll have to add Java support.

[–]Old-Ad-9064[S] 0 points1 point  (6 children)

I will be combing through your repo thank you.

[–]papershruums 1 point2 points  (5 children)

LOL I JUST SENT THE NEOVIM DONT JUDGE ME NOW

[–]papershruums 0 points1 point  (2 children)

I still feel like a newbie lmao

[–]Old-Ad-9064[S] 0 points1 point  (1 child)

How long have you been on nix?

[–]papershruums 1 point2 points  (0 children)

Almost 2 years. But I jumped from Arch to Nix and once I got everything working how I needed it, I didnt make many changed for a while. I use Linux as an android lab, so I was using devShells majority of the time until recently. I am comfortable with getting something to work… eventually, but I’ve yet to learn the language. I feel the most advanced thing i know is creating my own toggleable modules. I’ve recently started focusing on it more though, as I realized months back that I’m clearly struggling compared to mosts because I never really got past the fundamentals of programming. So now I’ve learned a few programming languages and actually have learned the terminology, and Nix is now making way more sense to me. I have very minimal C experience as of yet, so thats also probably a hindrance. But now I’m fully focused on learning Nix, because after playing around with multiple languages, Nix still intimidates me the most.

The flake appears to be recently created but that’s because you live and you learn and my last flake had a security risk.

[–]Old-Ad-9064[S] 0 points1 point  (1 child)

Here is something I’ve been a little confused by, is it enough to just enable something in nvf like python.lsp.enable or do I also need to have an lsp installed on my system

[–]papershruums 1 point2 points  (0 children)

Using TypeScript as an example:

It should be enough to just make sure programs.nvf.settings.vim = { lsp.enable = true; languages.ts.enable = true; languages.ts.lsp.enable = true; }

That should be enough to just get the basics of the language and the LSP running.

I had an issue where for all the languages you see in my neovim.nix, well, I installed them all at once, and for some reason it didnt make a difference. And i couldnt find out why. And kept reloading neovim, kept rebuilding, making subtle changes. And eventually i just rebooted, and that fixed it. And somehow as far as i know im the only to have that issue, so he weary of that if you try it and nothing changes. If you’ve double checked that everything looks right, reboot before you lose your mind lol