Code Monkey home page Code Monkey logo

nixos-pi4's Introduction

Building a NixOS SD Card/USB image for a Raspberry Pi 4 + remote rebuild/deployment

  1. Host setup in configuration.nix (if your host has another architecture (e.g. x86_64) than the raspberry pi)
  boot.binfmt.emulatedSystems = ["aarch64-linux"];
  nix.settings.extra-platforms = config.boot.binfmt.emulatedSystems;
  1. Update common.nix

In particular, don't forget:

  • to configure your network
  • to change the admin user able to connect through ssh
  • add hosts public ssh key to connect without password
  1. Build the image
nix build -L .#nixosConfigurations.pi4.config.system.build.sdImage
  1. Copy the image in your sd card
DEVICE=/dev/sdd # Whatever your sd card reader or usb device is
sudo dd if=result/sd-image/pi.img of=$DEVICE bs=1M conv=fsync status=progress
  1. Boot your Pi

  2. From another machine, rebuild the system:

For Pi 4:

nix --extra-experimental-features nix-command --extra-experimental-features flakes run --system aarch64-linux github:serokell/deploy-rs .#pi4 -- --ssh-user pi --hostname 10.10.10.74

Notes

  • Various features are much better supported on the Pi 4 than on the Zero 2 W because the Pi 4 has a nixos-hardware profile.
    • 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.
  • the sdImage.extraFirmwareConfig option is not ideal as it cannot update config.txt after it is created in the sd image.

See also

nixos-pi4's People

Contributors

mcdonc avatar bnlrnz avatar plmercereau avatar rjpcasalino avatar

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.