How to build a package in a local clone of nixpkgs
For example, if you need to update hashes manually, or test package in the shell
First, clone nixpkgs:
git clone https://github.com/NixOS/nixpkgs
Then, run from nixpkgs folder:
nix repl
# or, if some env variables is needed (e.g. NIXPKGS_ALLOW_INSECURE):
nix repl --impure
And then in the repl:
- Load nixpkgs:
:l . - Reload nixpkgs after editing packages:
:r - Build a package:
:b pkgs.your-package - Build a package and open shell with it:
:u pkgs.your-package