rpi4: initial commit
This commit is contained in:
parent
0e552c9a94
commit
c98a6a01d9
65
hardware/raspberry_pi_4_model_B.nix
Normal file
65
hardware/raspberry_pi_4_model_B.nix
Normal file
|
@ -0,0 +1,65 @@
|
|||
# Configuration common to all Raspberry Pi 4 Model B devices
|
||||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}: {
|
||||
boot = {
|
||||
initrd = {
|
||||
availableKernelModules = [
|
||||
"usbhid"
|
||||
"usb_storage"
|
||||
];
|
||||
};
|
||||
kernelPackages = pkgs.linuxKernel.kernels.linux_rpi4; # For a Raspberry Pi 4
|
||||
kernelParams = [
|
||||
"cma=128M" # Many GUI programs need this, nearly all wayland applications
|
||||
"8250.nr_uarts=1"
|
||||
"console=ttyAMA0,115200" # the serial console broken out to the GPIO
|
||||
"console=tty1"
|
||||
];
|
||||
loader = {
|
||||
grub = {
|
||||
enable = false; # NixOS wants to enable GRUB by default.
|
||||
};
|
||||
raspberryPi = {
|
||||
enable = true;
|
||||
version = 4;
|
||||
};
|
||||
};
|
||||
tmpOnTmpfs = true;
|
||||
};
|
||||
|
||||
# File systems configuration for using the installer's partition layout
|
||||
fileSystems = {
|
||||
"/" = {
|
||||
device = "/dev/disk/by-label/NIXOS_SD";
|
||||
fsType = "ext4";
|
||||
};
|
||||
"/boot/firmware" = {
|
||||
device = "/dev/disk/by-label/FIRMWARE";
|
||||
fsType = "vfat";
|
||||
# Alternatively, this could be removed from the configuration.
|
||||
# The filesystem is not needed at runtime, it could be treated
|
||||
# as an opaque blob instead of a discrete FAT32 filesystem.
|
||||
options = ["nofail" "noauto"];
|
||||
};
|
||||
};
|
||||
|
||||
# !!! Adding a swap file is optional, but strongly recommended!
|
||||
swapDevices = [
|
||||
{
|
||||
device = "/swapfile";
|
||||
size = 1024;
|
||||
}
|
||||
];
|
||||
|
||||
hardware = {
|
||||
enableRedistributableFirmware = true; # Enable support for Pi firmware blobs
|
||||
};
|
||||
|
||||
environment.systemPackages = with pkgs; [
|
||||
libraspberrypi # Userland tools for the Raspberry Pi board
|
||||
];
|
||||
}
|
|
@ -5,7 +5,7 @@
|
|||
lib,
|
||||
...
|
||||
}: {
|
||||
imports = [../hardware/odroid-hc4];
|
||||
imports = [../hardware/raspberry_pi_4_model_B.nix];
|
||||
|
||||
# Comment out deployment when building the SD Image.
|
||||
deployment.targetHost = "10.42.0.108";
|
||||
|
@ -27,5 +27,5 @@
|
|||
gnupg # GPL OpenPGP implementation
|
||||
];
|
||||
|
||||
system.stateVersion = "21.05"; # The version of NixOS originally installed
|
||||
system.stateVersion = "22.05"; # The version of NixOS originally installed
|
||||
}
|
||||
|
|
13
images/sd-image_ceilidh.nix
Normal file
13
images/sd-image_ceilidh.nix
Normal file
|
@ -0,0 +1,13 @@
|
|||
# SD image for ceilidh
|
||||
#
|
||||
# To build this image, run:
|
||||
#
|
||||
# nix-build '<nixpkgs/nixos>' -A config.system.build.sdImage -I \
|
||||
# nixos-config=./images/sd-image_ceilidh.nix
|
||||
#
|
||||
# An example of how to write the image to SD card:
|
||||
#
|
||||
# bzcat ./result/sd-image/nixos-sd-image-20.03.1577.74a80c5a9ab-aarch64-linux.img.bz2 | sudo dd of=/dev/sdb
|
||||
{...}: {
|
||||
imports = [./sd-image_paidh-aarch64.nix ../hosts/ceilidh.nix];
|
||||
}
|
|
@ -15,7 +15,7 @@
|
|||
in {
|
||||
imports = [
|
||||
<nixpkgs/nixos/modules/profiles/base.nix>
|
||||
<nixpkgs/nixos/modules/installer/cd-dvd/sd-image.nix>
|
||||
<nixpkgs/nixos/modules/installer/sd-card/sd-image.nix>
|
||||
];
|
||||
|
||||
boot.consoleLogLevel = lib.mkDefault 7;
|
||||
|
|
Loading…
Reference in a new issue