15 Nix
Anthony Wang edited this page 2023-09-21 02:42:12 +00:00

Nix is a purely functional package manager for installing packages.

Configuration

Run

nix-channel --add https://nixos.org/channels/nixpkgs-unstable
nix-channel --update

to configure a channel (repository).

Now add the ~/.nix-profile/bin directory to your $PATH. For Fish, you can do this with fish_add_path ~/.nix-profile/bin.

Usage

Description Command Example
List all installed packages nix-env -q nix-env -q
Query installed packages nix-env -q search_term nix-env -q librewolf
Query Available packages nix-env -qa search_term nix-env -qa calibre
Install package nix-env -iA nixpkgs.pkg_name nix-env -iA nixpkgs.sakura
Upgrade single package nix-env -u pkg_name nix-env -u librewolf
Upgrade all packages nix-env -u nix-env -u
Uninstall package nix-env -e pkg_name nix-env -e sakura

Note: Installed binaries are stored in ~/.nix-profile/bin

Tips and tricks

For graphical acceleration, desktop integration, and fixing locale warnings, consult the ArchWiki.