Nixtamal 0.2.0-beta released
0.1.1-beta made it to NixOS unstable (see: NixOS Search). 0.2.0-beta has an open pull request.
This version has bugfixes as well as a new feature: fetch-time: build | eval on supported inputs (file, archive, git) which allows you to choose eval-time fetchers (so builtins.fetch*) over the build time ones (pkgs.fetch*). This puts the user in control, but can technically also free one from needing Nixpkgs now (tho Nixpkgs is required if using patches, using Darcs/Pijul, or you want offline caching, hashing, & all the other things we have come to expect from pkgs.fetch*).
Thank you everyone for the feedback. I made a number of changes to the static site to cover some questions I got from various platforms. Special shout-out to @WeetHet for fixing the Darwin build & suggesting fetch-time.
TODO: fetch-time needs to added to nixtamal show.
One emergent, albeit “impure”, feature I found was using
inputs = import ./nix/tamal { bootstrap-nixpkgs = <nixpkgs>; }
In certain cases I think it’s a fine enough tradeoff to prefer the system’s pkgs.fetch* as they are stable enough for bootstrapping (& we do do some feature checking anyhow). This matters since the builtins caching is stored differently causing the user to download Nixpkgs twice (once with builtins for bootstrapping, then again when imported as inputs.nixpkgs). I have been trialing this pattern today
# release.nix
import ./release.nix { }
# release-lib.nix
{ system ? builtins.currentSystem, bootstrap-nixpkgs ? null }:
let
inputs = import ./nix/tamal { inherit system bootstrap-nixpkgs; };
pkgs = import inputs.nixpkgs { inherit system; overlays = [/*…*/]; };
in
{ inherit (pkgs.my-scope) default dev-shell my-package; }
# release-dev.nix
import ./release-lib.nix { bootstrap-nixpkgs = <nixpkgs>; }
# shell.nix
(import ./release-dev.nix).dev-shell
# default.nix
(import ./release.nix).default
Which lets me use the system’s Nixpkgs for the dev-shell where I mostly want Nix to bootstrap as quickly as possible, but can also do nix-build ./release-dev.nix -A my-package with the same tradeoff. This is not pure evaluation from top to bottom, but everything beyond fetching the sources into the Nix store is pure which often fits “good enough” criteria. release-lib.nix could be extended with architectures if needed like how upstream Nixpkgs does it, but for my use cases, this hasn’t been needed. Alternatively I could just set fetch-time=eval for Nixpkgs if it’s supported (meaning patches weren’t added).