← All commands

npkg

Manage the current Nix profile

Package Updates

Usage reference

Try an example

npkg add bat

Syntax

npkg <command> [args]
Availability
Available when nix is installed
Dependencies
nix; jq and fzf 0.68.0+ for optional workflows

Some subcommands change stored data or packages. Check the selected operation before running.

Features & Examples

Examples appear only where they add useful detail.

add [pkg ...]

Add package(s); with no args opens an fzf pickerAlso known as: install [pkg ...]

Example
npkg add bat
find [query]

Fuzzy-pick nixpkgs attribute names and add selections

Example
npkg find nvim
search <query>

Run a plain nixpkgs search with descriptions

Example
npkg search ripgrep
list

List packages in the current profile

remove [pkg ...]

Remove package(s); with no args opens an fzf picker

outdated

Compare installed and evaluated Nix output identities

refresh

Rebuild the cached nixpkgs attribute index

upgrade [pkg ...]

Upgrade all packages or only the named ones

help

Show this help text

Notes

  • Bare install names are expanded to nixpkgs#<name>
  • npkg find searches a cached list of nixpkgs attribute names
  • npkg refresh and outdated need jq
  • Interactive add/find/remove needs jq and fzf 0.68.0+
  • Advanced nix flags can be passed through by calling nix directly