| 15 Dec 2024 |
@megmug:matrix.org | Huh, 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 | In any case, it doesn't seem to be nix's fault | 17:48:19 |
@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 | Does 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 | direnv | 18:36:10 |
alexfmpe | I don't currently trust these tools much myself and just relaunch from the shell annoying as it is | 18:38:48 |
alexfmpe | 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 | 18:39:35 |
alexfmpe | Too much yolo nesting IMO | 18:40:24 |
@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 | 18:41:37 |
maralorn | 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 | I 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 work | 18:43:25 |
alexfmpe | 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 | 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 | I 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 files | 18:45:11 |
@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 | It better work flawlessly when someone else git pulls new nix | 18:45:33 |
alexfmpe | 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 | If you break the nix, now you can't laucnh the editor | 18:46:56 |
@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 | I 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 thing | 18:47:46 |
@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 | The problem is this is turtles all the way down, and needs to be modelled as such | 18:48:49 |
alexfmpe | But nix only does that for builds | 18:49:05 |
alexfmpe | I'd want some top level thing automagically gracefully reloading my editor as I changed the config files using that same editor | 18:50:19 |
alexfmpe | Because everything else will have stale state, which is a good way to push broken things you thought were working | 18:50:49 |
alexfmpe | Now, if you can get something not quite correct that still works 99% of the time then sure | 18:51:25 |
alexfmpe | I'm just not convinced the direnv I tried is that thing | 18:51:54 |
@megmug:matrix.org | If 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 haha | 18:52:06 |
@megmug:matrix.org | But even then, you still need the fitting os and system to run that | 18:52:30 |
alexfmpe | I've had similar issues when trying to pin nixpkgs inside configuration.nix itself | 18:53:03 |