I’m trying to install VS Code, but here’s what I get when I run nixos-rebuild switch
with this config (permalink):
building Nix...
building the system configuration...
activating the configuration...
setting up /etc...
reloading user units for sage...
restarting sysinit-reactivation.target
warning: the following units failed: home-manager-sage.service
× home-manager-sage.service - Home Manager environment for sage
Loaded: loaded (/etc/systemd/system/home-manager-sage.service; enabled; preset: ignored)
Active: failed (Result: exit-code) since Mon 2024-12-09 13:34:45 AST; 293ms ago
Invocation: 6760b56a6aa442c9ae0970499cde5b20
Process: 16076 ExecStart=/nix/store/m91h9kmjw78swvldfb9px8qnv1nb23ax-hm-setup-env /nix/store/pfrfqnpsa23wmv14c135iv2nw7i4qhzf-home-manager-generation (code=exited, status=126)
Main PID: 16076 (code=exited, status=126)
IP: 0B in, 0B out
IO: 0B read, 0B written
Mem peak: 5.7M
CPU: 374ms
Dec 09 13:34:45 azure hm-activate-sage[16202]: installing 'home-manager-path'
Dec 09 13:34:45 azure hm-activate-sage[16076]: Activating linkGeneration
Dec 09 13:34:45 azure hm-activate-sage[16076]: Cleaning up orphan links from /home/sage
Dec 09 13:34:45 azure hm-activate-sage[16076]: Creating profile generation 17
Dec 09 13:34:45 azure hm-activate-sage[16076]: Creating home file links in /home/sage
Dec 09 13:34:45 azure hm-activate-sage[16076]: Activating onFilesChange
Dec 09 13:34:45 azure hm-activate-sage[16280]: /nix/store/cr1rwsrwb8pbd0l8j12kasy3bsl56zn2-vscode-1.95.2/bin/.code-wrapped: line 63: /nix/store/cr1rwsrwb8pbd0l8j12kasy3bsl56zn2-vscode-1.95.2/lib/vscode/code: Input/output error
Dec 09 13:34:45 azure systemd[1]: home-manager-sage.service: Main process exited, code=exited, status=126/n/a
Dec 09 13:34:45 azure systemd[1]: home-manager-sage.service: Failed with result 'exit-code'.
Dec 09 13:34:45 azure systemd[1]: Failed to start Home Manager environment for sage.
warning: error(s) occurred while switching to the new configuration
Oddly, subsequent runs of nixos-rebuild switch
succeeds with no errors, but then trying to run code
produces this:
/nix/store/cr1rwsrwb8pbd0l8j12kasy3bsl56zn2-vscode-1.95.2/bin/.code-wrapped: line 63: /nix/store/cr1rwsrwb8pbd0l8j12kasy3bsl56zn2-vscode-1.95.2/lib/vscode/code: Input/output error
Tried it multiple times to the same effect, so I assume it’s just reusing cache (I ran nix-collect-garbage --delete-old
thinking it’d work, but no). I’m assuming it based on cr1rwsrwb8pbd0l8j12kasy3bsl56zn2
being the same every time, but not sure if that’s relevant.
Any way to purge that VS Code version and reinstall it fresh? Or any other suggestions?
PS: I tried installing VS Code before I came to know about home-manager
. That time it also failed to run with an I/O error, but the rebuild error was likely different (forgot what it was tho…).