I’ve been using NixOS for a few months now, and my only issue is that I just can’t get VSCodium’s integrated terminal to run sudo or pkexec. It’s not a massive deal, but it is frustrating.
When I try to run codium --disable-chromium-sandbox, I get a blank window.
At this point, I’ve tried everything I could find on Nix support forums, so I’m hoping someone here can help if I ask about this specifically
For reference, I use the vscodium-fhs package, installed through Home Manager.
I’m happy to share sections of my config as needed
Ah, well QuBe, you see, the problem with that idea… Is that it’s an EXCELLENT idea that I wish I’d tried before I made a fool of myself. Using vscodium instead of the fhs alternative does the trick!
# Imported in my home-manager config
programs.vscodium = {
enable = true;
package = pkgs.vscodium; # used to be vscodium-fhs
# some settings and extensions...
};
Oh and since we’re here, nixpkgs only ships with some “common” vs code/codium extensions, and you can quickly find yourself needing something outside of that set.
If you ever reach this case, you can use nix-vscode-extensions to have basically the full set (through something like extensions = with pkgs.nix-vscode-extensions.open-vsx; [ ... ])
I guess it’s mostly due to my progressive migration from VSCode:
I started with vscode, Setting Sync failed to install extensions (possibly a couple years ago)
I switched to vscode-fhs and everything worked as it used to on Arch. I might have started at skipped step 1 this time around due to my memory of my first attempt at nixifying.
I ported my settings over to Home Manager, with the express purpose of moving to VSCodium and away from MS’s copilotification of VSCode. I also started fetching my extensions from Nix from that point on.
I experimented by having programs.vscode = { package = pkgs.vscodium-fhs; };, keeping the fhs out of continuity more than reason.
Thanks to you, I now know that I could’ve just gone for the standard package at step 4
I guess docs could be improved on the FHS section by specifically warning about that side effect; the current warning about purity that’s already here isn’t quite as much of a deterrent as “you won’t be able to obtain priviledges”.
Something along the lines of “Because the FHS variant uses chroot (I assume), VSCodium will run in an isolated environment, and won’t be able to use sudo to edit privileged files, nor will the terminal let you run commands as root.” (please word it less poorly and with fewer technical errors than this, I’m aiming for vibe more than accuracy here).
Thanks for the pointer to nix-vscode-extension, I’ll add it to my flake.nix if I find myself missing some extensions
Note:︎ buildFHSEnv allows for ease-of-use at the cost of impurity, non-reproducibility, and denied root access (you cannot use sudo in .fhs packages, also see [1])
Though even that note can be improved, because I have no idea what “ease of use” means here.