-
First, add
asdfto the Nix configuration with the package namedasdf-vm. Add the following line to yourconfiguration.nixfile:environment.systemPackages = with pkgs; [ asdf-vm ];
-
Next, add the following lines to your
.bashrcfile:. "$HOME/.nix-profile/share/asdf-vm/asdf.sh" . "$HOME/.nix-profile/share/bash-completion/completions/asdf.bash"
These lines will load
asdfinto your shell. -
Reload your
.bashrcor open a new terminal to apply the changes. -
Verify that
asdfis properly installed by running the following command:asdf --version
This should output the version number of
asdf.
That's it! Now you can use asdf with Nix.
Looks like the latest asdf (0.18) doesn't use
${pkgs.asdf-vm}/etc/profile.d/asdf-prepare.shanymore. It looks like we want to use${pkgs.asdf-vm}/etc/profile.d/asdf-prepare.shinstead?