Nix: I can't build NixOS images with nixUnstable

Created on 6 Apr 2017  Β·  9Comments  Β·  Source: NixOS/nix

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

Most helpful comment

Maybe this will motivate me to finish my image PR πŸ˜„

All 9 comments

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

@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.

Was this page helpful?
0 / 5 - 0 ratings