Skip to content

Instantly share code, notes, and snippets.

@xorilog
Forked from axelbdt/install_asdf_with_nix.md
Created March 14, 2024 12:36
Show Gist options
  • Select an option

  • Save xorilog/b9f9d5a105f82e0a66f0f4bccd6e6f64 to your computer and use it in GitHub Desktop.

Select an option

Save xorilog/b9f9d5a105f82e0a66f0f4bccd6e6f64 to your computer and use it in GitHub Desktop.
How to Install asdf with Nix Home-manager

How to Install asdf with Nix Home-manager

  1. First, add asdf to the Nix configuration with the package named asdf-vm. Add the following line to your configuration.nix file:

    environment.systemPackages = with pkgs; [
      asdf-vm
    ];
  2. Next, add the following lines to your .bashrc file:

    . "$HOME/.nix-profile/share/asdf-vm/asdf.sh"
    . "$HOME/.nix-profile/share/bash-completion/completions/asdf.bash"

    These lines will load asdf into your shell.

  3. Reload your .bashrc or open a new terminal to apply the changes.

  4. Verify that asdf is 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment