When the Wakatime Extension gets installed in Visual Studio Code, it does not extract the Wakatime CLI. This guide is how to have it use the Wakatime that is installed in NixOS.
Note: This explains how to get it working without using the official NixOS method of installing extensions for VS Code.
Install Wakatime in NixOS
First, install Wakatime in NixOS:
nix-env -i wakatime
Make a note of the /nix/store location for the
bin/wakatime file, as we will use it later on.
Find Wakatime Extension Location
Now you must find the location of run the
wakatime-cli executable for the extension. Ctrl + Shift + I (Help -> Toggle Developer Tools). It will have errors that have
EONET in it and spawn errors. Look for the path where it’s trying to launch from, in my instance, it’s
Create a Symbolic Link to Wakatime
I had to create the
wakatime-cli directory in
wakatime.vscode-wakatime-4.0.0 and then do a symbolic link to where
nix-env command installed it.
This is an example of the command I used (be sure to change the nix store and Wakatime Extension location if different):
ln -s /nix/store/zjzh8fh8gcdlkvaj6i5wpcbd9jki2fj9-wakatime-13.0.7/bin/wakatime ~/.vscode/extensions/wakatime.vscode-wakatime-4.0.0/wakatime-cli/wakatime-cli
If you forgot to grab the
/nix/store location for Wakatime, you will need to go into the
nix repl and do a search query for it:
Each time the Wakatime Extension upgrades to a new version, you may have to repeat the same process.