Giter Club home page Giter Club logo

nixos-on-arm's Introduction

NixOS on ARM Build Status

This is a WIP to cross compile NixOS to run on ARM targets.

Table of Contents

Building

Clone the latest release:

git clone -b 0.7.0 --recursive --shallow-submodules https://github.com/illegalprime/nixos-on-arm.git
cd nixos-on-arm

This repository was reorganized to be able to build different boards if/when different ones are written. To build use:

nix build -f . \
  -I nixpkgs=nixpkgs \
  -I machine=machines/BOARD_TYPE \
  -I image=images/NIX_CONFIGURATION

Using Cachix

This repository uses Travis to keep a fresh cachix cache, which you can use to speed up your builds:

# install cachix if you haven't already
nix-env -iA cachix -f https://cachix.org/api/v1/install
# use this cache when building
cachix use cross-armed

A Note on Image Size

Many things affect image size and recently a lot of work has been done to minimize it:

  1. splitting gcc libs into different output (NixOS/nixpkgs#58606)
  2. strip in cross builds (NixOS/nixpkgs#59787) (NixOS/nixpkgs#21667 (comment)) (NixOS/nixpkgs#15339)

A lot of things still have to be done to remove x86 remnants from accidentally getting into the image (like updating patchShebangs NixOS/nixpkgs#33956), and contaminants can be checked by running ./check-contamination.sh result.

See the Images Overview for a breakdown of image sizes.

BeagleBone Green

nix build -f . \
  -I nixpkgs=nixpkgs \
  -I machine=machines/beaglebone \
  -I image=images/ap-puns

Currently images/ap-puns provides a service which will send out AP beacons of WiFi puns. This is a demo showing how one can build their own OS configured to do something out-of-the-box. (NOTE you need a USB WiFi dongle, I included kernel modules for the Ralink chipset)

I think it's neat, much better than installing a generic Linux and configuring services yourself on the target.

UniFi Controller

You can build an image which starts a UniFi controller so you don't have to buy one! This is useful if you have a UniFi router or AP, which uses this controller for extra memory and processing power. Currently tested with the beaglebone:

nix build -f . \
  -I nixpkgs=nixpkgs \
  -I machine=machines/beaglebone \
  -I image=images/unifi

Since the beaglebone is slow, it could take a while to boot.

Raspberry Pi Zero (W)

Both raspberry pi zeros are supported now! They come with cool OTG features:

nix build -f . \
  -I nixpkgs=nixpkgs \
  -I machine=machines/raspberrypi-zerow \
  -I image=images/rpi0-otg-serial

This will let you power and access the Raspberry Pi via serial through it's USB port. Be sure to plug your micro USB cable in the data port, not the power port.

The first boot takes longer since it resizes the SD card to fill its entire space, so the serial device (usually /dev/ttyACM0) might take longer to show up.

You can also build an image with turns the USB port into an Ethernet adapter, letting you SSH into the raspberry pi by plugging it into your computer:

nix build -f . \
  -I nixpkgs=nixpkgs \
  -I machine=machines/raspberrypi-zerow \
  -I image=images/rpi0-otg-ether

copy it to an SD card ('Installing' section), plug it in, wait for it to boot and to show up as an Ethernet device, then just:

Raspberry Pi 2

The Raspberry Pi 2 is a 32-bit quad core @ 900MHz ARMv7 board with 1GB of RAM. You can build for the Raspberry Pi 2, and it works with NixOps!

nix build -f . \
  -I nixpkgs=nixpkgs \
  -I machine=machines/raspberrypi-2 \
  -I image=images/nixops

Raspberry Pi 3

The Raspberry Pi 3 is a 64-bit quad core @ 1.2GHz ARMv8 board with 1GB of RAM. It also has built-in 802.11n WiFi, and 10/100 Ethernet port. Bluetooth doesn't work on this platform yet. You can build for the Raspberry Pi 3, and it works with NixOps!

nix build -f . \
  -I nixpkgs=nixpkgs \
  -I machine=machines/raspberrypi-3 \
  -I image=images/nixops

Odroid C2

This was a really interesting board to work on and a lot of help was taken from jumpnow/meta-odroid-c2. It's a good example of how to build u-boot, sign it, and couple it with vendor-specific boot loader code. This is a pretty good reference implementation for secure-boot and 64-bit arm boards. Build it with:

nix build -f . \
  -I nixpkgs=nixpkgs \
  -I machine=machines/odroid-c2 \
  -I image=images/ssh

I haven't implemented building an SD burner for this board yet, but it should be straightforward to do and it will be implemented once I buy an eMMC.

Toradex Apalis IMX6 (Community)

Board configurations for this just landed thanks to @deadloko! I do not own this board so I cannot test it on every release, but it should be similar to the BeagleBone. Build it with:

nix build -f . \
  -I nixpkgs=nixpkgs \
  -I machine=machines/toradex_apalis_imx6 \
  -I image=images/mini

Burning to an SD Card

bmap is really handy here (nix-shell -p bmap-tools).

sudo bmaptool copy --nobmap result/sd-image/*.img /dev/sdX

Burning to the eMMC

When your image is all ironed out you might want to store it in a more permanent place on your board: the eMMC. This type of storage is great because it can't be easily dislodged like an SD card, but it's harder to access.

If you have an SD card port and an eMMC you're in luck, this repository defines an output (a directory in outputs) that will build an SD card image that will boot and burn another image onto the eMMC. You specify the image you want burned with the usual -I image= option.

We now use bmaptool to burn the image over which is faster, has integrity checks, and makes sure to sync the file system. We also compress the image so that it can be safely copied over to the burner image.

All you have to do is use the burner output:

nix build \
  -f outputs/burner \
  -I nixpkgs=nixpkgs \
  -I machine=machines/beaglebone \
  -I image=images/nixops

Burn the result to an SD card (see Burning to an SD Card) and boot into it. If LEDs for this board were configured, you should see one of the following patterns:

  1. Each LED lighting up one by one in sequence means the eMMC is being written to.
  2. All LEDs on means the write has finished successfully, the board will soon be powered off.
  3. All LEDs blinking slowly means an error has occurred during the writing process.

(note that on the BeagleBone you must hold the USER button down, plug in power, then let go to boot into your SD card if there's already a boot loader on the eMMC)

Adding Burner Support to Your Board

If you're writing the definition for a board you might want to enable support for this feature, to do so just implement the options in the crosspkgs/modules/hardware/burner module, which at the time of writing consists of only a couple of options:

  1. hardware.burner.disk: the path to dd the image into (the path of the eMMC device)
  2. hardware.burner.preBurnScript: a script to run before dd is called

You may also define LEDs in the crosspkgs/modules/hardware/leds module, which the burner script will use to display its status. LEDs are just names of directories in the /sys/class/leds/ directory.

Take a look at the beaglebone image definition if you want a concrete example.

NixOps Deployments

NixOps support is here! That means you can manage all your devices without re-flashing!

The Setup

To start burn a base image onto an SD card (this image just contains SSH and a larger boot partition to store new configurations in):

nix build -f . \
  -I nixpkgs=nixpkgs \
  -I machine=machines/beaglebone \
  -I image=images/nixops

Then boot it and add your SSH key because NixOps only supports SSH keys:

# copy over the key
ssh-copy-id root@IP_ADDRESS

# load your SSH keys into your environment
eval $(ssh-agent -s)
ssh-add ~/.ssh/id_rsa

Finally, create a NixOps deployment for your devices (iot can be changed to anything):

nixops create ./nixops.nix -d iot

Deploying New Configurations

Now you're ready to update your board with some new configurations! Just use nixops deploy with the IP environment variable set to the your device's (here we deploy the ap-puns image over our original nixops image):

IP=YOUR_DEVICES_IP \
  nixops deploy \
  -I nixpkgs=nixpkgs \
  -I machine=machines/beaglebone \
  -I image=images/ap-puns \
  -d iot

If you have access to a serial connection, you can pick your generation on boot:

------------------------------------------------------------
1:      NixOS - Default
2:      NixOS - Configuration 2 (2019-09-16 14:23 - 19.09pre-git)
3:      NixOS - Configuration 1 (1970-01-01 01:32 - 19.09pre-git)
Enter choice:

Otherwise you can take out the SD card and manually edit the /extlinux/extlinux.conf file in the boot partition. Replace DEFAULT nixos-default with DEFAULT nixos-42 in that file to temporarily boot from the 42nd generation.

Debugging

Sometimes when thing go wrong you need to test specific parts of the build, this repository is organized so it's easy to do that.

Let's say dhcp was broken, you can build just that package with:

nix build -f . \
  -I nixpkgs=nixpkgs \
  -I machine=machines/beaglebone \
  -I image=images/mini \
  pkgs.dhcp

Similarly you can drop into a shell to inspect the build process for dhcp like:

nix-shell --pure . \
  -I nixpkgs=nixpkgs \
  -I machine=machines/beaglebone \
  -I image=images/mini \
  -A pkgs.dhcp

then you can just call genericBuild in the nix-shell and simulate building that package.

If you wanted to inspect the final configuration values and other stuff, you can drop into a repl:

nix repl . \
  -I nixpkgs=nixpkgs \
  -I machine=machines/beaglebone \
  -I image=images/mini \

Then the variable config contains the system configuration.

Images Overview

Some images are full-fledged demos with a use case, and others are just templates for you to build your own images with.

Image Templates

(the size is based off BeagleBone builds)

Name Size Description
base > 2GB the smallest changes to the nix configuration needed to cross-build
mini 584MB smaller than base, with most non-critical services turned off, like polkit, udisks, containers, etc.
micro 564MB smaller than mini, meant to be flashed once and not updated directly (but updated by flashing another image)
ssh 584MB based off mini but with SSH access

The micro image isn't very micro right now, but hopefully it will be soon. It's meant to not have any nix utilities or the daemon, a smaller kernel, and generally the bare minimum needed to run on the board. Currently, it's not very different from the mini image.

Demos

  1. ap-puns use aircrack-ng to send out fake AP Beacons with pun names
  2. rpi0-otg-ether run a Raspberry Pi 0 as an Ethernet Adapter with SSH in OTG mode
  3. rpi0-otg-serial run a Raspberry Pi 0 as a serial adapter
  4. unifi boot into a UniFi controller that manages UniFi APs

Contributing

For inspiration either look at the currently open issues or What Needs to Be Done. Otherwise just try it out and put in fixes as you find them, ultimately all fixes that end up here will be sent upstream so all of nixpkgs can benefit.

Alternatively, send it directly upstream and link the commit in an issue, it will possibly be cherry-picked here.

Current State

What Works

  1. BeagleBone Green (and now the Raspberry Pi Zero & Zero W!)
  2. Networking & SSH
  3. the BeagleBone's UART (Raspberry Pi Zero's serial port)
  4. a bunch of standalone packages (vim, nmap, git, gcc, python, etc.)
  5. all the nix utilities!
  6. the USB port!

What Doesn't Work

  1. nix channels are also not packaged with the image for some reason do nix-channel --update
  2. there's still a good amount of x86 stuff that gets in there accidentally
  3. bluetooth on the raspberry pi zeros (and likely on all the other platforms)

What Needs to Be Done

For Fun

nixos-on-arm's People

Contributors

deadloko avatar illegalprime avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

nixos-on-arm's Issues

Raspberry Pi Zero OTG not working

I'm pretty sure it worked at edb7a3c (0.6.0) but now it doesn't, maybe because of the bootloader change but equally likely because I just forgot how to do it right. We'll see!

cross compile bluez

this is possibly the last piece of hardware that needs to be supported to fully support the RPi zero AND the Raspberry Pi 3 & 4.

micro image needs more free space

the micro image currently doesn't have enough free space to boot (currently an extra 20MB of space is given to it). possible solutions:

  1. figure out what's taking up so much space at boot and minimize it (hardest)
  2. make the boot-resizing process take up less space in extra utils (harder)
  3. load a mini image and see how much extra space it takes up compared to how much it started with, use this value to update the micro image (easy).

if no. 3 is implemented this could be a good beginner task.

Infinite recursion error

I'm trying to compile for BeagleBone on MacOS. I'm new to Nix, so maybe this is too many things to try to do at once. I'm not sure how to debug this error further.

commit 7709513b41b0c1c50ed5b4e3b3644cd34b26652c (HEAD, tag: 0.7.0, origin/master, origin/HEAD)

$ nix build -f . -I nixpkgs=nixpkgs -I machine=machines/beaglebone -I image=images/micro --show-trace
error: while evaluating the attribute 'buildCommand' of the derivation 'nixos-on-beaglebone-19.09pre-git-armv7l-linux.img-armv7l-unknown-linux-gnueabihf' at /Users/dan/nixos-on-arm/nixpkgs/pkgs/stdenv/generic/make-derivation.nix:196:11:
while evaluating the attribute 'buildCommand' of the derivation 'ext4-fs.img-armv7l-unknown-linux-gnueabihf' at /Users/dan/nixos-on-arm/nixpkgs/pkgs/stdenv/generic/make-derivation.nix:196:11:
while evaluating the attribute 'PATH' of the derivation 'closure-info' at /Users/dan/nixos-on-arm/nixpkgs/pkgs/build-support/closure-info.nix:14:3:
while evaluating the attribute '__impureHostDeps' of the derivation 'coreutils-8.31' at /Users/dan/nixos-on-arm/nixpkgs/pkgs/stdenv/generic/make-derivation.nix:190:11:
while evaluating 'unique' at /Users/dan/nixos-on-arm/nixpkgs/lib/lists.nix:630:12, called from /Users/dan/nixos-on-arm/nixpkgs/pkgs/stdenv/generic/make-derivation.nix:173:9:
while evaluating anonymous function at /Users/dan/nixos-on-arm/nixpkgs/pkgs/stdenv/generic/make-derivation.nix:173:36, called from /Users/dan/nixos-on-arm/nixpkgs/pkgs/stdenv/generic/make-derivation.nix:173:21:
while evaluating the attribute 'bash' at /Users/dan/nixos-on-arm/nixpkgs/pkgs/top-level/all-packages.nix:6735:3:
while evaluating 'addMetaAttrs' at /Users/dan/nixos-on-arm/nixpkgs/lib/meta.nix:15:28, called from /Users/dan/nixos-on-arm/nixpkgs/pkgs/top-level/all-packages.nix:6735:10:
while evaluating 'callPackageWith' at /Users/dan/nixos-on-arm/nixpkgs/lib/customisation.nix:108:35, called from /Users/dan/nixos-on-arm/nixpkgs/pkgs/top-level/all-packages.nix:6735:19:
while evaluating 'makeOverridable' at /Users/dan/nixos-on-arm/nixpkgs/lib/customisation.nix:67:24, called from /Users/dan/nixos-on-arm/nixpkgs/lib/customisation.nix:112:8:
while evaluating anonymous function at /Users/dan/nixos-on-arm/nixpkgs/pkgs/shells/bash/4.4.nix:1:1, called from /Users/dan/nixos-on-arm/nixpkgs/lib/customisation.nix:69:12:
while evaluating 'wrapBintoolsWith' at /Users/dan/nixos-on-arm/nixpkgs/pkgs/top-level/all-packages.nix:7901:5, called from /Users/dan/nixos-on-arm/nixpkgs/pkgs/top-level/all-packages.nix:8636:14:
while evaluating 'callPackageWith' at /Users/dan/nixos-on-arm/nixpkgs/lib/customisation.nix:108:35, called from /Users/dan/nixos-on-arm/nixpkgs/pkgs/top-level/all-packages.nix:7905:7:
while evaluating 'makeOverridable' at /Users/dan/nixos-on-arm/nixpkgs/lib/customisation.nix:67:24, called from /Users/dan/nixos-on-arm/nixpkgs/lib/customisation.nix:112:8:
while evaluating anonymous function at /Users/dan/nixos-on-arm/nixpkgs/pkgs/build-support/bintools-wrapper/default.nix:8:1, called from /Users/dan/nixos-on-arm/nixpkgs/lib/customisation.nix:69:12:
while evaluating the attribute 'cc.nativeTools' at /Users/dan/nixos-on-arm/nixpkgs/pkgs/stdenv/generic/default.nix:148:14:
while evaluating anonymous function at /Users/dan/nixos-on-arm/nixpkgs/pkgs/build-support/cc-wrapper/default.nix:8:1, called from /Users/dan/nixos-on-arm/nixpkgs/pkgs/stdenv/darwin/default.nix:84:49:
while evaluating the attribute 'installPhase' of the derivation 'Libsystem-osx-10.11.6' at /Users/dan/nixos-on-arm/nixpkgs/pkgs/os-specific/darwin/apple-source-releases/default.nix:153:5:
while evaluating the attribute 'buildInputs' of the derivation 'xnu-osx-10.11.6' at /Users/dan/nixos-on-arm/nixpkgs/pkgs/os-specific/darwin/apple-source-releases/default.nix:153:5:
while evaluating the attribute 'nativeBuildInputs' of the derivation 'bootstrap_cmds-dev-tools-7.0' at /Users/dan/nixos-on-arm/nixpkgs/pkgs/os-specific/darwin/apple-source-releases/default.nix:153:5:
while evaluating the attribute 'nativeBuildInputs' of the derivation 'bison-3.3.2' at /Users/dan/nixos-on-arm/nixpkgs/pkgs/stdenv/generic/make-derivation.nix:190:11:
while evaluating the attribute 'postPatch' of the derivation 'perl-5.28.1' at /Users/dan/nixos-on-arm/nixpkgs/pkgs/development/interpreters/perl/default.nix:30:5:
while evaluating the attribute 'nativeBuildInputs' of the derivation 'coreutils-8.31' at /Users/dan/nixos-on-arm/nixpkgs/pkgs/stdenv/generic/make-derivation.nix:190:11:
infinite recursion encountered, at undefined position

lighttpd crosscompilation

Lighttpd fails to cross compile, but i managed to fix it in NixOS/nixpkgs#61128.
This issue is just informational for people to know that there is a solution for this problem, and pull request on nixpkgs master already opened.

add runtime shell as a build input to all derivations

fixing the patchShebangs script to respect cross compilation is incredibly important for reducing image size and build contamination. the script works by searching the build source for #! /path/to/binary in executable files and then replacing that binary with one from $PATH (which is populated with binaries from the nix store).

in this PR NixOS/nixpkgs#43833 (that was reverted) patchShebangs works by populating $PATH with binaries from buildInputs (to get host binaries and not build-time binaries). this works exactly the same except in the case of bash, which is never listed in buildInputs and is always implicitly in $PATH during non-cross builds (because of stdenv).

therefore we need to add the runtimeShell package as a buildInput to every derivation so patchShebangs can pick up on that package when doing its magic. this most likely means editing stdenv to include that package in its default list of buildInputs.

cleanup raspberry pi 2 config

Raspberry Pi 2 has landed ! ! ! ๐Ÿ˜ฎ

some things still need cleanup, but the bare minimum needed to get it to boot is already there, so it just needs docs.

nixpkgs upstreaming

Is it reasonable to upstream all the nixpkgs-level work into nixpkgs proper? How much work would this be?

Missing options error

I'm new to Nix so forgive me if I'm missing something obvious, but I get the following errors on both MacOS and NixOS running in VirtualBox:

$ nix build -f . -I nixpkgs=nixpkgs  -I machine=machines/beaglebone -I image=images/mini
error: The option `documentation' defined in `/vagrant/images/mini' does not exist.
(use '--show-trace' to show detailed location information)

$ nix build -f . -I nixpkgs=nixpkgs -I machine=machines/beaglebone -I image=images/base
error: The option `boot.loader.generic-extlinux-compatible.dtbs' defined in `/vagrant/machines/beaglebone' does not exist.
(use '--show-trace' to show detailed location information)

re-organize image names

smaller, minimal, base don't have a good intuitive meaning, & minimal contains an SSH daemon, so writing docs about these and renaming them to be more intuitive would (I believe) be a great help.

support burning to and booting from eMMC

this issue is two fold:

  1. be able to build an image that will be written to an SD card that, when booted, dds another image onto the on-board eMMC
  2. be able to build an image that can boot from that eMMC

both are pretty straightforward, the only reason for no. 2 is that some u-boot tweaks are needed to boot from the eMMC. Maybe a u-boot module needs to happen.

support Raspberry Pi 3

getting the RPi 3 to work with https://pi-hole.net/ would be a good demo and a useful use case, but first we need to get the board working.

this should be straightforward as nixpkgs already supports this board pretty well, these links should help:

  1. https://nixos.wiki/wiki/NixOS_on_ARM/Raspberry_Pi
  2. https://github.com/NixOS/nixpkgs/blob/master/nixos/modules/installer/cd-dvd/sd-image-aarch64.nix
  3. https://github.com/NixOS/nixpkgs/blob/fc48e74127c08ac44f56f3535dc09648ba5ef57d/lib/systems/platforms.nix#L314-L347

mender support

Officially adding this to the roadmap, this is a tracking issue.

standardize on extlinux bootloaders

There's a lot of unnecessary variety in boot loaders across boards, I think standardizing on uboot + extlinux is what's best for now.

  • get rid of unnecessary boot.loader.*.enable = false;
  • convert uEnv.txt boards into extlinux (this is the hardest one of the bunch)
  • use the config.system.build.installBootloader where appropriate instead of importing the builder directly like sd-image.nix does.
  • separate build-time and host-time extlinux builders
  • get rid of build-time binaries in builder
  • optionally refine the list of dtbs copied over to the /boot partition

machines to convert:

  • Odroid-C2
  • Raspberry Pi Zero (W)
  • Raspberry Pi 2
  • BeagleBone

this will make nixops and nixos-rebuild work better, but it may run into issues with mender...
we'll see

Any plans to merge nixpkgs into mainline?

I'm fairly new to nix and don't know the mode but do you plan to post a pull request to NixOS? Is there a commitment on the part of NixOS to reach full cross compiling support for these arm architectures and the particular boards?

Help with network (wireless) connection on Raspberry Pi Zero W

Hi there, I'm using the image built from the raspberrypi-zerow using otg-ether from the following build command:

nix build -f . \
  -I nixpkgs=nixpkgs \
  -I machine=machines/raspberrypi-zerow \
  -I image=images/rpi0-otg-ether

and I'm having trouble setting up the wireless connection after booting. I'm able to successfully ssh over USB, but then I'm having trouble setting up wpa_supplicant. I had hoped to be able to launch the wpa_supplicant systemd service as described in the NixOS installation manual (https://nixos.org/manual/nixos/stable/index.html#sec-installation-booting-networking) but it seems that systemctl start wpa_supplicant) is not working on this build, which also means that I can't get wpa_cli to work. I was wondering if you'd been able to test wireless setup using this image and whether you have any advice for getting this to work. Thanks in advance!

Raspberry Pi 1 B+

The ZeroW image in the Releases only seems to get me stuck in a bootloop of some kind:

My Great Capture Screenshot 2021-02-27 15-36-12

This page says that I should be able to find a NixOS image for the 1 B+ but I so far have been entirely unable to outside of this repository being linked.

What do I do?

crossed cachix

Hi, I'm using vanilla sd_image vanilla nixos in rpi3+. Use cachix by default. Why cross compiled packages use different cachix than aarch64? Are the outputs different when native vs cross compilations?

Just for curiosity, I'm noob in cross compiling... Thanks for your work.

volume_key compilation failure.

First of all, great effort for replacing yocto with nix build system. I have a custom board based on toradex apalis imx6 SOC, so I wanted to try if I can run nix on it. I have written configuration files based on rpi examples, but when I tried to build sd image, i ran into compilation error.

Error log:

nix build -f . \
  -I nixpkgs=nixpkgs \
  -I machine=machines/toradex_apalis_imx6 \
  -I image=images/minimal

builder for '/nix/store/mwm4n5i1i0qkrdaqpd578l7z4basgqgy-volume_key-0.3.11-armv7l-unknown-linux-gnueabihf.drv' failed with exit code 2; last 10 log lines:
  libtool: compile:  armv7l-unknown-linux-gnueabihf-gcc -DHAVE_CONFIG_H -I. -I/nix/store/dgijzk00lch1wg43c7ymj9qnbg2jv6gn-util-linux-2.33.1-armv7l-unknown-linux-gnueabihf-dev/include/blkid -I/nix/store/vf5042zi9xqv7gjrj17df5a249x9xkh8-glib-2.58.2-armv7l-unknown-linux-gnueabihf-dev/include/glib-2.0 -I/nix/store/kp65kyax63l43i1yavj2wzjf5rlh3w98-glib-2.58.2-armv7l-unknown-linux-gnueabihf/lib/glib-2.0/include -I/nix/store/vxmbjw65x5489z96bqggd5vwvqx7k4g5-gpgme-1.12.0-armv7l-unknown-linux-gnueabihf-dev/include -I/nix/store/9b9583z5252pf2nihgqcv46anag1k1rf-libassuan-2.5.2-armv7l-unknown-linux-gnueabihf-dev/include -I/nix/store/x6si6j0lmmp94k32wsv8k8ljv2kfcay8-libgpg-error-1.34-armv7l-unknown-linux-gnueabihf-dev/include -I/nix/store/ikv8b4gsnhldy6mxzzmcsdk2cdwjc8r7-cryptsetup-2.1.0-armv7l-unknown-linux-gnueabihf-dev/include -I/nix/store/1j5fmphfraiz5sp6ic36dxal6djvs37s-nss-3.42.1-armv7l-unknown-linux-gnueabihf-dev/include/nss -I/nix/store/nybzl0bnkmh9zzrgp2xkwglrrz9d7hab-nspr-4.20-armv7l-unknown-linux-gnueabihf-dev/include -g -O2 -Wall -W -Wcast-align -Wmissing-noreturn -Wnested-externs -Wpointer-arith -Wshadow -Wundef -Wwrite-strings -c python/volume_key_wrap.c  -fPIC -DPIC -o python/.libs/_volume_key_la-volume_key_wrap.o
  python/volume_key_wrap.c:149:11: fatal error: Python.h: No such file or directory
   # include <Python.h>
             ^~~~~~~~~~
  compilation terminated.
  make[2]: *** [Makefile:1091: python/_volume_key_la-volume_key_wrap.lo] Error 1
  make[2]: Leaving directory '/build/volume_key'
  make[1]: *** [Makefile:1234: all-recursive] Error 1
  make[1]: Leaving directory '/build/volume_key'
  make: *** [Makefile:745: all] Error 2
cannot build derivation '/nix/store/l66rj7kmv95nm0qh91va4fpkkl9q0r1d-libblockdev-2.20-armv7l-unknown-linux-gnueabihf.drv': 1 dependencies couldn't be built
cannot build derivation '/nix/store/h4zn8sdb42zn052r2dhd5w0c2nj1520c-udisks-2.8.2-armv7l-unknown-linux-gnueabihf.drv': 1 dependencies couldn't be built
cannot build derivation '/nix/store/0wcffjayikmczx3ixp370bfh06q21972-dbus-1.drv': 1 dependencies couldn't be built
cannot build derivation '/nix/store/0a5nkxvzkiy9iap37iw477pls9sypjmz-hwdb.bin.drv': 1 dependencies couldn't be built
cannot build derivation '/nix/store/6xz2h018p5h0p8yhd5g9vvvz1k5qjrkv-system-path.drv': 1 dependencies couldn't be built
cannot build derivation '/nix/store/v17g2kk40xc8g651qv1046pbgc4qwzgz-system-units.drv': 1 dependencies couldn't be built
cannot build derivation '/nix/store/hz446anikgdjyis3czs3xwxlyh5p1xbr-udev-rules.drv': 1 dependencies couldn't be built
cannot build derivation '/nix/store/xqqfd7msas64r3a4gdnzh3p6l9wa2iyg-user-units.drv': 1 dependencies couldn't be built
cannot build derivation '/nix/store/qyanxh77x51a71v5rcs6wrvd3gr6k7ka-nixos-system-nixos-on-arm-19.09pre-git.drv': 1 dependencies couldn't be built
cannot build derivation '/nix/store/d51z0dpcdfg686i41lzldp6q3p9zi7zf-closure-info.drv': 1 dependencies couldn't be built
cannot build derivation '/nix/store/gxlmn65finvkyr4fha25k1cnckxwkbqm-uEnv.txt.drv': 1 dependencies couldn't be built
cannot build derivation '/nix/store/hx8fsg0njsdh1v4wykk91p24aj3aqdg3-nixos-sd-image-19.09pre-git-armv7l-linux.img-armv7l-unknown-linux-gnueabihf.drv': 1 dependencies couldn't be built
[0 built (1 failed), 0.0 MiB DL]
error: build of '/nix/store/hx8fsg0njsdh1v4wykk91p24aj3aqdg3-nixos-sd-image-19.09pre-git-armv7l-linux.img-armv7l-unknown-linux-gnueabihf.drv' failed

EDIT: Minimal image for beaglebone fails with the same error:

nix build -f . \
  -I nixpkgs=nixpkgs \                                                                                                                                                                                              
  -I machine=machines/beaglebone \                                                                                                                                                                                  
  -I image=images/minimal

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.