NixOS on ARM/Raspberry Pi: Difference between revisions

imported>EyJhb
Changed `YES*` to `YES` as it once were (re-added for no reason), re-added Pi 400 as that was also removed for some reason
imported>Skylark
Raspberry Pi 4B: Replace with link to NixOS on ARM/Raspberry Pi 4 which seems to be more up to date
Line 154: Line 154:
</syntaxHighlight>
</syntaxHighlight>


=== Raspberry Pi 4B ===
=== Raspberry Pi 4 ===
Support for the Pi 4 in nixpkgs is still experimental. These configurations will boot (from [https://github.com/NixOS/nixpkgs/pull/68265#issuecomment-532040372 this PR comment]):
''See'' [[NixOS on ARM/Raspberry Pi 4]]


==== Without GPU ====
=== Audio ===
{{file|/etc/nixos/configuration.nix|nix|<nowiki>
{ pkgs, ... }:
 
{
  imports = [ </nowiki><nixpkgs/nixos/modules/installer/cd-dvd/sd-image-raspberrypi4.nix><nowiki> ];
 
  networking.wireless.enable = false;
  services.xserver = {
    enable = true;
    displayManager.slim.enable = true;
    desktopManager.gnome3.enable = true;
    videoDrivers = [ "fbdev" ];
  };
}
</nowiki>}}
 
==== With GPU ====
{{file|/etc/nixos/configuration.nix|nix|<nowiki>
{ pkgs, ... }:
 
{
  imports = [ </nowiki><nixpkgs/nixos/modules/installer/cd-dvd/sd-image-raspberrypi4.nix><nowiki> ];
 
  networking.wireless.enable = false;
  hardware.opengl = {
    enable = true;
    setLdLibraryPath = true;
    package = pkgs.mesa_drivers;
  };
  hardware.deviceTree = {
    base = pkgs.device-tree_rpi;
    overlays = [ "${pkgs.device-tree_rpi.overlays}/vc4-fkms-v3d.dtbo" ];
  };
  services.xserver = {
    enable = true;
    displayManager.slim.enable = true;
    desktopManager.gnome3.enable = true;
    videoDrivers = [ "modesetting" ];
  };
 
  boot.loader.raspberryPi.firmwareConfig = ''
    gpu_mem=192
  '';
}
</nowiki>}}
 
==== Audio ====


In addition to the usual config, it might be required to enable audio support explicitly in the firmwareConfig.
In addition to the usual config, it might be required to enable audio support explicitly in the firmwareConfig.