Giter Club home page Giter Club logo

nixos-pi-zero-2's Introduction

Building a NixOS SD image for a Raspberry Pi Zero 2 w

  1. Update zero2w.nix

In particular, don't forget:

  • to configure your wifi
  • to add an admin user able to connect through ssh
  1. Build the image
nix build -L .#nixosConfigurations.zero2w.config.system.build.sdImage
  1. Copy the image in your sd card
DEVICE=/dev/disk5 # Whatever your sd card reader is
sudo dd if=result/sd-image/zero2.img of=$DEVICE bs=1M conv=fsync status=progress
  1. Boot your Zero
  2. Get your IP
ifconfig wlan0
  1. From another machine, rebuild the system:
ZERO2_IP=<the-zero2-ip>
SSH_USER=<the-admin-user-in-the-pi>
nix run github:serokell/deploy-rs .#zero2w -- --ssh-user $SSH_USER --hostname $ZERO2_IP

Notes

  • The Zero 2 doesn't have enough RAM to build itself. An initial lead was to create a swap partition, but it turns out it was a bad idea, as it would have decreased the sd card lifetime (sd cards don't like many write operations). A zram swap is not big enough to work. Hence the use of deploy-rs.
    • Note that nixos-rebuild --target-host would work instead of using deploy-rs. but as nixos-rebuild is not available on Darwin, I'm using deploy-rs that works both on NixOS and Darwin.
  • I still couldn't find a way to use boot.kernelPackages = pkgs.linuxKernel.packages.linux_rpi3.
  • the sdImage.extraFirmwareConfig option is not ideal as it cannot update config.txt after it is created in the sd image.

See also

nixos-pi-zero-2's People

Contributors

plmercereau avatar rjpcasalino avatar

Stargazers

Cheng avatar Daniel avatar Bartłomiej Chmiel avatar Tamás Hetesi avatar Paul Cormack avatar  avatar Jay Rovacsek avatar Matt Carrier avatar ℤhichu ℂhen avatar  avatar Mauricio Scheffer avatar William Vandervalk avatar Julien Muniak avatar Patrick O'Doherty avatar Pete avatar Jakub Kozłowski avatar Fábio Oliveira avatar  avatar Alex Vorobiev avatar James Sully avatar  avatar

Watchers

Alex Vorobiev avatar ℤhichu ℂhen avatar Daniel avatar  avatar  avatar

nixos-pi-zero-2's Issues

Question: Building from x86_64-linux

Curious to try building this from a linux box! Any pointers to updated resources on how to work around the following?

~/nixos-config main *+                                                                                                                                                                                                                                                                                                   
❯ nix build -L .#nixosConfigurations.zero2w.config.system.build.sdImage
error: a 'aarch64-linux' with features {} is required to build
'/nix/store/dg8m1dlmqb9i11290ywlan5bwmj49fdf-config.txt.drv', 
but I am a 'x86_64-linux' with features {benchmark, big-parallel, kvm, nixos-test}

Best regards,
Torgeir

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.