Closed ce-dot closed 1 year ago
I just tried it in a VM and cannot reproduce your problem. Can you give me more context about where you are installing this? Is just a regular NixOS installation?
Had the same problem, and these instructions on the README solved it for me:
Enabling the user service creates a symlink to the Nix store, but the linked store path could be garbage collected at some point. One workaround to this particular issue is creating the following symlink:
ln -sfT /run/current-system/etc/systemd/user/auto-fix-vscode-server.service ~/.config/systemd/user/auto-fix-vscode-server.service
That worked, thanks (and ouch)! Sorry for the hassle!
ce@nuc-nixos ~ % systemctl --user enable auto-fix-vscode-server.service
Failed to enable unit: Unit file auto-fix-vscode-server.service does not exist.
1 ce@nuc-nixos ~ % ln -sfT /run/current-system/etc/systemd/user/auto-fix-vscode-server.service ~/.config/systemd/user/auto-fix-vscode-server.service
ce@nuc-nixos ~ % systemctl --user start auto-fix-vscode-server.service
ce@nuc-nixos ~ % systemctl --user status auto-fix-vscode-server.service
● auto-fix-vscode-server.service - Automatically fix the VS Code server used by the remote SSH extension
Loaded: loaded (/etc/systemd/user/auto-fix-vscode-server.service; enabled; preset: enabled)
Active: active (running) since Fri 2023-06-16 21:39:41 CEST; 4s ago
Main PID: 15774 (auto-fix-vscode)
Tasks: 2 (limit: 18673)
Memory: 1.7M
CPU: 32ms
CGroup: /user.slice/user-1000.slice/user@1000.service/app.slice/auto-fix-vscode-server.service
├─15774 /nix/store/7q1b1bsmxi91zci6g8714rcljl620y7f-bash-5.2-p15/bin/bash /nix/store/ndrrfpa8qm9rq3ikhqmygzd05nvicqrp-auto-fix-vscode-server/bin/auto-fix-vscode-server
└─15780 inotifywait -q -m -e CREATE,ISDIR -e DELETE_SELF --format %f:%e /home/ce/.vscode-server/bin
Jun 16 21:39:41 nuc-nixos systemd[1360]: Started Automatically fix the VS Code server used by the remote SSH extension.
Jun 16 21:39:41 nuc-nixos auto-fix-vscode-server[15774]: Patching Node.js of VS Code server installation in /home/ce/.vscode-server/bin/b380da4ef1ee00e224a15c1d4d9793e27c2b6302...
P.S. Good job on this unit btw!
This flake does not seem to produce a systemd service for me.
My flake.nix reads (shortened version)
But when I try to enable the service with
systemctl --user enable auto-fix-vscode-server.service
(or disable, start) it says the unit file does not exist.What am I doing wrong?