NixOS on ARM/Raspberry Pi 5: Difference between revisions
m migrate templates |
→Proposed Solution: document/promote building on Raspberry Pi OS, an easy way to get going |
||
| (2 intermediate revisions by 2 users not shown) | |||
| Line 72: | Line 72: | ||
{{Note|The author of the following section acknowledges that this may not be the best (or even intended) process. These instructions are provided on a best effort basis. If you have a better set of instructions, please contribute them to this section, replacing this content, and removing this notice.}}Setting up a NixOS system on your Raspberry Pi 5 consists of a number of steps. First, it's important to get a SD Image installer onto the device. If you're not currently running on an ARM system (almost definitely the case), you have three options: | {{Note|The author of the following section acknowledges that this may not be the best (or even intended) process. These instructions are provided on a best effort basis. If you have a better set of instructions, please contribute them to this section, replacing this content, and removing this notice.}}Setting up a NixOS system on your Raspberry Pi 5 consists of a number of steps. First, it's important to get a SD Image installer onto the device. If you're not currently running on an ARM system (almost definitely the case), you have three options: | ||
# | # Bootstrap a build machine onto the Raspberry Pi 5, for example with a standard Raspberry Pi OS SD card (use rpi-imager to enable sshd and set wifi credentials for a headless experience), `apt install nix` and run nix as root | ||
# Hope that the compiled image is available in the cache | # Cross compile the image | ||
# Hope that the compiled image is available in the cache | |||
=== Step 1: Building the SD Image === | === Step 1: Building the SD Image === | ||
| Line 83: | Line 83: | ||
nix.settings.trusted-users = [ "your-username" ]; | nix.settings.trusted-users = [ "your-username" ]; | ||
<nowiki>}</nowiki>|name=configuration.nix|lang=nix}} | <nowiki>}</nowiki>|name=configuration.nix|lang=nix}} | ||
Afterwards, you can build one of the SD images:<syntaxhighlight lang=" | Afterwards, you can build one of the SD images:<syntaxhighlight lang="console"> | ||
$ nix build github:nvmd/nixos-raspberrypi#installerImages.rpi5 | $ nix build github:nvmd/nixos-raspberrypi#installerImages.rpi5 | ||
</syntaxhighlight>You can either [[Cross Compiling|cross-compile]] the image on your system, or alternatively, you can install the "normal" Raspberry Pi OS on your Raspberry Pi 5, then install Nix standalone (multi-user), and set it up as a [[distributed build]] machine. | </syntaxhighlight>You can either [[Cross Compiling|cross-compile]] the image on your system, or alternatively, you can install the "normal" Raspberry Pi OS on your Raspberry Pi 5, then install Nix standalone (multi-user), and set it up as a [[distributed build]] machine. | ||
Finally, simply copy the image to the current directory from the <code>result</code> directory, extract it and write it to the SD card. You can find more information on the [[NixOS on ARM/Installation]] page. | Finally, simply copy the image to the current directory from the <code>result</code> directory, extract it and write it to a USB drive, and boot to this drive on the raspberry pi (by default the raspberry pi will first try to boot the SD card, then the USB drive, so just don't put any SD card when booting and plug it later. Note that since the installer will format the SD card, you cannot put the installer on the SD card itself). You can find more information on the [[NixOS on ARM/Installation]] page. | ||
=== Step 2: Installing NixOS === | === Step 2: Installing NixOS === | ||