DEV Community

BlackBeard
BlackBeard

Posted on

Getting started with Nix Package Manager

Nix is a standalone package manager from the NixOS family that can be installed on other Linux/Unix OS.

https://nixos.org/download.html

Installation:

To install nix on WSL:

sh <(curl -L https://nixos.org/nix/install) --no-daemon
Enter fullscreen mode Exit fullscreen mode

Then add source $HOME/.nix-profile/etc/profile.d/nix.sh to your .bashrc or .zshrc.

Usage:

  • Searching a package: nix-env -qa firefox
  • installing a package: nix-env -i firefox or nix-env -iA nixpkgs.firefox (works on non-nix OS only)
  • List installed packages: nix-env -q
  • Uninstall a package: nix-env -e firefox
  • Upgrade a package: nix-env -u firefox
  • Upgrade all packages: nix-env -u
  • Cleanup: nix-collect-garbage -d

Oldest comments (0)