Flakes: Difference between revisions

imported>Lolbinarycat
→‎Pinning the registry to the system pkgs on NixOS: add suggestion for how to make caching more reliable
imported>Lolbinarycat
→‎Development tricks: add a cool trick i found
Line 521: Line 521:


== Development tricks ==
== Development tricks ==
=== Build a package added in a PR ==
<syntaxHighlight>
nix build github:nixos/nixpkgs?ref=pull/<PR_NUMBER>/head#<PACKAGE>
</syntaxHighlight>
this allows building a package that has not yet been added to nixpkgs.
note that this will download a full source tarball of nixpkgs.  if you already have a local clone, using that may be faster due to delta compression:
<syntaxHighlight>
git fetch upstream pull/<PR_NUMBER>/head && git checkout FETCH_HEAD && nix build .#PACKAGE
</syntaxHighlight>
this allows building a package that has not yet been added to nixpkgs.
=== How to add a file locally in git but not include it in commits ===
=== How to add a file locally in git but not include it in commits ===