NixOS on ARM/Raspberry Pi 4: Difference between revisions

Nixoszz (talk | contribs)
Tags: Reverted Visual edit
Mmxgn (talk | contribs)
m remove extra whitespace
 
(14 intermediate revisions by 3 users not shown)
Line 27: Line 27:
|}
|}
</div>
</div>
Raspberry Pi系列设备是由Raspberry Pi基金会制造的一系列单板计算机。它们都基于Broadcom片上系统(SoC)。
The Raspberry Pi family of devices is a series of single-board computers made by the Raspberry Pi Foundation. They are all based on Broadcom System-on-a-chip (SoCs).


== 状态 ==
== Status ==


The Raspberry Pi 4 Family is only supported as '''AArch64'''. Use as armv7 is community supported.
The Raspberry Pi 4 Family is only supported as '''AArch64'''. Use as armv7 is community supported.
Line 77: Line 77:
   system.stateVersion = "24.11";
   system.stateVersion = "24.11";
}
}
</nowiki>}}
=== <code>config.txt</code> ===
{{warning|Since 24.11, the option <code>boot.loader.raspberrypi</code> which included <code>firmwareConfig</code> is removed from <code>nixpkgs</code>, therefore changes have to be written to <code>config.txt</code> directly<ref>https://github.com/NixOS/nixpkgs/pull/241534</ref>}}
To edit options only available through <code>config.txt</code>, as of May 12, 2025, you can only do so non-declaratively:
{{commands|<nowiki>
$ sudo mount /dev/disk/by-label/FIRMWARE /mnt
$ sudo vim /mnt/config.txt # <-- make changes here
</nowiki>}}
For example, [https://www.raspberrypi-spy.co.uk/2020/11/overclocking-the-raspberry-pi-400/ overclocking] the Raspberry Pi 400 can be done by adding the following:
{{file|config.txt|text|<nowiki>
arm_freq=2000
over_voltage=6
</nowiki>}}
</nowiki>}}


Line 139: Line 155:
   # Enable audio devices
   # Enable audio devices
   boot.kernelParams = [ "snd_bcm2835.enable_hdmi=1" "snd_bcm2835.enable_headphones=1" ];
   boot.kernelParams = [ "snd_bcm2835.enable_hdmi=1" "snd_bcm2835.enable_headphones=1" ];
  boot.loader.raspberryPi.firmwareConfig = ''
    dtparam=audio=on
  '';
}
}
</nowiki>}}
{{file|config.txt|txt|<nowiki>
dtparam=audio=on
</nowiki>}}
</nowiki>}}