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
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
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 .
:l .
- Reload nixpkgs after editing packages:
:r
:r
- Build a package:
:b pkgs.your-package
:b pkgs.your-package
- Build a package and open shell with it:
:u pkgs.your-package
:u pkgs.your-package