NixOS on ARM/Raspberry Pi 5: Difference between revisions
Line 62: | Line 62: | ||
Take note that this solution reuses the proprietary firmware distributed by The Raspberry Pi Foundation. If that's not desired, one of the ''Other Solutions'' may be preferable. | Take note that this solution reuses the proprietary firmware distributed by The Raspberry Pi Foundation. If that's not desired, one of the ''Other Solutions'' may be preferable. | ||
{{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.}} | {{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: | ||
# Cross compile the image (Note: an editor should add how-to information); | |||
# Hope that the compiled image is available in the cache; | |||
# Bootstrap a build machine onto the Raspberry Pi 5. | |||
=== Stage 1: Building the SD Image === | |||
{{Note|It might be possible to do the following steps via the official SD installer as well. If you manage to do it, please mark this section as optional and remove this notice.}}The project provides build images as well, which are modified versions of the nix-hardware ones. Before getting into building one, in order to make use of the community binary caches, and potentially avoid rebuilding the image, make sure you are added to the trusted users in your own nix configuration: | |||
{{File|filename=nix.conf|language=conf|contents=trusted-users = username}} | |||
Or, alternatively, in your nixos configuration: | |||
{{File|filename=configuration.nix|language=nix|contents={ | |||
nix.settings.trusted-users = [ "your-username" ]; | |||
<nowiki>}</nowiki>}} | |||
Afterwards, you can build one of the SD images:<syntaxhighlight lang="shell"> | |||
$ nix build github:nvdm/nixos-raspberrypi#installerImages.rpi5 | |||
</syntaxhighlight>Simply copy the image to the current directory from the <code>result</code> directory, extract it and write it to the SD card. | |||
== Other Solutions == | == Other Solutions == |