nix-edit

opens the Nix expression for a package in your editor

TLDR

Edit package definition
$ nix edit nixpkgs#[package]
Edit with specific editor
$ EDITOR=vim nix edit nixpkgs#[package]

SYNOPSIS

nix edit installable [options]

DESCRIPTION

nix edit opens the Nix expression for a package in your editor. Useful for inspecting or modifying package definitions. Uses $EDITOR environment variable.

PARAMETERS

installable

Package to edit (e.g., nixpkgs#hello).

INSTALL

sudo apt install nix-bin
sudo dnf install nix
sudo pacman -S nix
sudo apk add nix
sudo zypper install nix
nix profile install nixpkgs#nix

SEE ALSO

nix(1), nix-search(1)