!RbXGJhHMsnQcNIDFWN:nixos.org

Haskell in Nixpkgs/NixOS

713 Members
For discussions and questions about Haskell with Nix, cabal2nix and haskellPackages in nixpkgs | Current Docs: https://haskell4nix.readthedocs.io/143 Servers

Load older messages


SenderMessageTime
15 Dec 2024
@megmug:matrix.org@megmug:matrix.orgHuh, interesting, if i start it from the nix-shell it works depending on if the env-selector extension is active or not. It its active, it doesn't work (same hang as before) and if I start it with the env-selector disabled, it suddenly works.17:47:49
@megmug:matrix.org@megmug:matrix.orgIn any case, it doesn't seem to be nix's fault17:48:19
@megmug:matrix.org@megmug:matrix.org alexfmpe: Thanks for helping me diagnose the issue! It really seems to be the nix-environment-selector extension. Even though it loads the environment (it does say so on the bottom left) and even though the Haskell plugin output suggests it found the correct executables in the nix store, it just hangs after "invoking build tool to determine build flags (this may take some time depending on the cache)" without errors, just periodically saying "Live bytes: 0.00MB Heap size: 0.00MB". Something is borked there in a way that is non-obvious to me. But again, running vscode through nix-shell and disabling the extension fixes it. 18:15:53
@megmug:matrix.org@megmug:matrix.orgDoes anyone know of another simple way to have that nix-environment load on vscode start? Maybe other plugins with the same functionality?18:17:57
@vigress9:matrix.org@vigress9:matrix.orgdirenv18:36:10
@alexfmpe:matrix.orgalexfmpeI don't currently trust these tools much myself and just relaunch from the shell annoying as it is18:38:48
@alexfmpe:matrix.orgalexfmpeHave had stale state with direnv a couple times (at the terminal, not even in the editor) until I eventually went in and manually nuked the cache dir18:39:35
@alexfmpe:matrix.orgalexfmpeToo much yolo nesting IMO18:40:24
@megmug:matrix.org@megmug:matrix.orgHm, so direnv seems to be the de facto standard then. It is unfortunate that nix-environment-selector stopped working, because it can be loaded automatically as a plugin without external dependencies which makes working in teams easier18:41:37
@maralorn:maralorn.demaralorn
In reply to @alexfmpe:matrix.org
Have had stale state with direnv a couple times (at the terminal, not even in the editor) until I eventually went in and manually nuked the cache dir
Well, direnv has a caching layer which purposefully does not watch everything for updates, but "touch .envrc" always resets it for me.
18:43:23
@alexfmpe:matrix.orgalexfmpeI mean, I'd even like to offer a per project preconfigured editor with nix and all. But I'd think getting the layering right is massive work18:43:25
@alexfmpe:matrix.orgalexfmpe
In reply to @maralorn:maralorn.de
Well, direnv has a caching layer which purposefully does not watch everything for updates, but "touch .envrc" always resets it for me.
I mean, it better watch the file I entered the nix shell from and its transitive closure
18:44:09
@maralorn:maralorn.demaralorn
In reply to @megmug:matrix.org
Hm, so direnv seems to be the de facto standard then. It is unfortunate that nix-environment-selector stopped working, because it can be loaded automatically as a plugin without external dependencies which makes working in teams easier
I don't expect that extension to be generally broken. But I also have no experience with it.
18:44:41
@alexfmpe:matrix.orgalexfmpeI don't reload the nix shell that often that the convenience is worth causing stale state on the other team members that never touch nix files18:45:11
@megmug:matrix.org@megmug:matrix.org With the nix-envinroment-selector, i think it was pretty close to that. Your colleagues need to 1. install nix 2. open vscode, trust the workspace and let it install recommended plugins. done 18:45:16
@alexfmpe:matrix.orgalexfmpeIt better work flawlessly when someone else git pulls new nix 18:45:33
@alexfmpe:matrix.orgalexfmpe
In reply to @megmug:matrix.org
With the nix-envinroment-selector, i think it was pretty close to that. Your colleagues need to 1. install nix 2. open vscode, trust the workspace and let it install recommended plugins. done
Well, what editor do you edit the editor config on?
18:46:33
@alexfmpe:matrix.orgalexfmpeIf you break the nix, now you can't laucnh the editor18:46:56
@megmug:matrix.org@megmug:matrix.org Hm maybe, but even if it's just a small bug, the author seems to have vanished / semi-abandoned the project so even if it's some small issue it could be game over for the extension 18:47:01
@alexfmpe:matrix.orgalexfmpeI don't think this can't be solved properly, it's just tricky to get something robust when all these tools kinda just do their own thing18:47:46
@megmug:matrix.org@megmug:matrix.org Ok now I get what you mean. Yes you need to install vscode too. Which, on many systems could be as simple as "snap install code" or like on nixos changing a system config variable 18:48:19
@alexfmpe:matrix.orgalexfmpeThe problem is this is turtles all the way down, and needs to be modelled as such 18:48:49
@alexfmpe:matrix.orgalexfmpeBut nix only does that for builds18:49:05
@alexfmpe:matrix.orgalexfmpeI'd want some top level thing automagically gracefully reloading my editor as I changed the config files using that same editor18:50:19
@alexfmpe:matrix.orgalexfmpeBecause everything else will have stale state, which is a good way to push broken things you thought were working18:50:49
@alexfmpe:matrix.orgalexfmpeNow, if you can get something not quite correct that still works 99% of the time then sure18:51:25
@alexfmpe:matrix.orgalexfmpeI'm just not convinced the direnv I tried is that thing18:51:54
@megmug:matrix.org@megmug:matrix.orgIf you really want to completely solve this, you probably have to provide a self contained nix binary inside the project to build a complete VM that runs even the code editor haha18:52:06
@megmug:matrix.org@megmug:matrix.orgBut even then, you still need the fitting os and system to run that18:52:30
@alexfmpe:matrix.orgalexfmpeI've had similar issues when trying to pin nixpkgs inside configuration.nix itself18:53:03

Show newer messages


Back to Room ListRoom Version: 6