Create NixOS System image on RISC-V VisionFive (Embedded Linux via Nix/NixOS)

I made a youtube video that explains this in more detail

TL;DR

  1. Flash the bootloader with nix run github:matthewcroughan#flashBootloader
  2. nix build github:matthewcroughan/nixcfg#visionfive-cross
  3. Flash the result in ./result to an SD card
  4. Boot it!

If you want to customise it, modify the configuration.nix in this template, and watch the video to learn a bit more. If you have any questions, please post them here!

3 Likes

:+1:

List of GitHub repos related to running NixOS on VisionFive V1

NixOS Building parts:

Example NixOS configuration repos

The Flake URLs listed here can be used with the --flake option of nixos-rebuild. So for example to build my configuration just:

$ nixos-rebuild build --flake github:dramforever/nixos-visionfive#misaki

Or equivalently without using the nixos-rebuild script:

$ nix build github:dramforever/nixos-visionfive#nixosConfigurations.misaki.config.system.build.toplevel

No need to clone my repo: Nix will do this for you.

Of the configurations listed, those ending in -native are meant to be run on a machine that’s either natively riscv64 or has qemu-riscv64 binfmt configured. Others will build on a x64 machine and cross to riscv64.