I'm unsure whether I should file this under Nix for not being compatible with the perl substituter VM voodoo use in the image builder today, or under nixpkgs for using too much voodoo to build images.
Anyway, here's the tail of the log from building an Amazon-flavored VM:
updating size field on β/nix/store/zn4hbvb4642q84xgywgfx0pnjbrmlw3l-perl-5.22.2-manβ to 3226416
fixing missing hash on β/nix/store/znciivsfl8nxaqd3p2b0981z366cqb2b-bind-9.10.4-P6-libβ
updating size field on β/nix/store/znciivsfl8nxaqd3p2b0981z366cqb2b-bind-9.10.4-P6-libβ to 3201520
fixing missing hash on β/nix/store/zqbrq4gd402yfp0b3bbrckp4gnmzpxi7-dhcpcd-6.11.5β
updating size field on β/nix/store/zqbrq4gd402yfp0b3bbrckp4gnmzpxi7-dhcpcd-6.11.5β to 380720
fixing missing hash on β/nix/store/zskylj4ipgn3gibxwvpnf9pbj5n2sjf1-readline-7.0p0β
updating size field on β/nix/store/zskylj4ipgn3gibxwvpnf9pbj5n2sjf1-readline-7.0p0β to 402504
fixing missing hash on β/nix/store/zx23ra0npqn0xjp2n035s1rqibh28yxi-unit-dbus.socketβ
updating size field on β/nix/store/zx23ra0npqn0xjp2n035s1rqibh28yxi-unit-dbus.socketβ to 312
fixing missing hash on β/nix/store/zxpqiicdmipczkqq6640cfzi0yls53ay-fontconfig-ultimate-2016-04-23β
updating size field on β/nix/store/zxpqiicdmipczkqq6640cfzi0yls53ay-fontconfig-ultimate-2016-04-23β to 857864
Can't open perl script "use Nix::Config; Nix::Config::readConfig; print $Nix::Config::config{"binary-caches"};": No such file or directory
[ 208.159009] reboot: Power down
builder for β/nix/store/kgjjxncxn4ask5qc2haxjbqkqldlki21-nixos-disk-image.drvβ failed with exit code 2
I think the longer-term solution is to adopt my (still WIP) PRs to improve (and vastly speed up) image building, but until those are done and merged, I'm not sure what to do.
cc @edolstra @domenkozar @shlevy
nix-perl defined in release.nix has the nix bindings. Perhaps we should add that to nixpkgs? @edolstra
@shlevy would we then plug that into https://github.com/NixOS/nixpkgs/blob/master/nixos/modules/installer/tools/nixos-install.sh#L199?
@copumpkin I think we'd need to resurrect old versions of those somehow and link them to nix-perl
Maybe this will motivate me to finish my image PR π
Okay, just successfully built a nixUnstable image with https://github.com/NixOS/nixpkgs/pull/21943 (30 minutes -> 1 minute) and apart from using the new awesome nixUnstable, I also found a bug in it. So I guess consider me motivated to finish all that work again now π
@copumpkin The installer requires Nix 1.11 at the moment, it won't work with 1.12. It will require a few changes (use nix copy instead of rsync for the initial bootstrap, use local?root=/tmp/root as a substituter instead of copy-from-other-stores.pl). For the Nix::Config issue, we should add a nix subcommand for querying config settings.
(Actually we can probably get rid of copying Nix entirely and use local?root=/mnt as the store URI when building the NixOS config.)
@edolstra yeah, I've been using my other image building machinery that doesn't use the installer at all (but rather the factored out nixos-prepare-root.sh stuff you might have seen in my other PRs) that largely makes that stuff not matter anymore. Of course, factoring the logic that way makes other things a bit tricky, so it isn't merged yet π
Building images should work on the nix-2.0 branch of the nixpkgs repo.
Most helpful comment
Maybe this will motivate me to finish my image PR π