Giter Site home page Giter Site logo

nixos-on-arm-examples's Introduction

NixOS on ARM Examples

Examples of Nix expressions for cross compiling NixOS images for ARM

Customizing

If you want to setup wireless networking, public SSH keys or the like, copy custom.nix.template to custom.nix and edit its content to your requirements.

Building

Set BOARD_TYPE to the desired value and run the command as shown below.

$ export BOARD_TYPE=foobar
# nixpkgs pinned to master as of Thu Mar 31 08:01:29 2022 -0700
$ export NIXPKGS="https://github.com/NixOS/nixpkgs/archive/3e481ad.tar.gz"
$ nix-build -I nixpkgs=$NIXPKGS -I machine=machines/$BOARD_TYPE --out-link out-links/$BOARD_TYPE

Boards

BOARD_TYPE can be set to the name of any directory in machines.

Board BOARD_TYPE
generic AArch64 generic-aarch64
generic ARMv7l generic-armv7l-hf
ESPRESSObin espressobin
Orange Pi Zero orange-pi-zero
ROC-RK3328-CC roc-rk3328-cc
Raspberry Pi Zero W raspberry-pi-zero-w

Building All

Run this command to build images for all available boards. I just added this section to have something to copy and paste for a "release build".

$ export NIXPKGS=https://github.com/NixOS/nixpkgs/archive/3e481ad.tar.gz
$ for machine in $(find machines -maxdepth 1 -mindepth 1 -type d)
do
    export BOARD_TYPE=$(basename $machine);
    nix-build -I nixpkgs=$NIXPKGS -I machine=machines/$BOARD_TYPE --out-link out-links/$BOARD_TYPE
done

Flashing

# set correct path for SD card
export SD_CARD=/dev/sda
# inflate image and write to SD card
zstd -dcf out-links/$BOARD_TYPE/sd-image/*.img.zst | sudo dd status=progress bs=64k iflag=fullblock oflag=direct of=$SD_CARD && sync && sudo eject $SD_CARD

Attribution

nixos-on-arm-examples's People

Contributors

cyber-murmel avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

nixos-on-arm-examples's Issues

How to nixos rebuild?

Hello, I have been tinkering with this project, and I have a question. I have managed to build a RPI0 image with mediamtx, but to proper configure it I need to edit /etc/media.yml... wich nano saiy its RO even with sudo... So I guess that I need to leverage nix for the edit of this file, it can be done with options... my point is, how can I nixos-rebuild swtich when there is no /etc/configuration.nix? winch one should I use? can the build nix be modify to copy the proper ones to /etc... or to /boot? so that they can be edited from another computer?

Thank you for this awesome work!

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.