nix edit

Open the Nix expression of a Nix package in $EDITOR. More information: https://nixos.org/manual/nix/stable/command-ref/new-cli/nix3-edit.html.

nix edit {{nixpkgs#pkg}}

EDITOR=cat nix edit {{nixpkgs#pkg}}