From 39a962f8acdaeb52b9847c8b1ea8e3b79e66825f Mon Sep 17 00:00:00 2001 From: Bailey Stevens Date: Wed, 20 Sep 2023 18:37:50 -0400 Subject: [PATCH] Switched to raspi 4 --- flake.lock | 17 +++++++++++++++++ flake.nix | 3 +++ platforms/orange.nix | 13 +++++++++++-- 3 files changed, 31 insertions(+), 2 deletions(-) diff --git a/flake.lock b/flake.lock index f4c1ede..e541e2a 100644 --- a/flake.lock +++ b/flake.lock @@ -70,6 +70,22 @@ "type": "github" } }, + "nixos-hardware": { + "locked": { + "lastModified": 1695109627, + "narHash": "sha256-4rpyoVzmunIG6xWA/EonnSSqC69bDBzciFi6SjBze/0=", + "owner": "NixOS", + "repo": "nixos-hardware", + "rev": "cb4dc98f776ddb6af165e6f06b2902efe31ca67a", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "master", + "repo": "nixos-hardware", + "type": "github" + } + }, "nixpkgs": { "locked": { "lastModified": 1683408522, @@ -106,6 +122,7 @@ "inputs": { "colmena": "colmena", "flake-utils": "flake-utils_2", + "nixos-hardware": "nixos-hardware", "nixpkgs": "nixpkgs_2" } }, diff --git a/flake.nix b/flake.nix index 7785bbb..2bfeb48 100644 --- a/flake.nix +++ b/flake.nix @@ -5,6 +5,8 @@ nixpkgs.url = "github:nixos/nixpkgs/nixos-23.05"; flake-utils.url = "github:numtide/flake-utils"; colmena.url = "github:zhaofengli/colmena"; + + nixos-hardware.url = "github:NixOS/nixos-hardware/master"; }; outputs = inputs@{self, nixpkgs, flake-utils, ...}: @@ -43,6 +45,7 @@ ./citrus.nix "${nixpkgs}/nixos/modules/installer/sd-card/sd-image-aarch64.nix" ./platforms/orange.nix + inputs.nixos-hardware.nixosModules.raspberry-pi-4 ]; in { # Colmena deploy manifest diff --git a/platforms/orange.nix b/platforms/orange.nix index a8a5098..1ab1c56 100644 --- a/platforms/orange.nix +++ b/platforms/orange.nix @@ -3,8 +3,17 @@ nixpkgs.hostPlatform.system = "aarch64-linux"; sdImage.imageName = "orange.img"; - boot.loader.raspberryPi.version = 3; - boot.initrd.kernelModules = [ "vc4" "bcm2835_dma" "i2c_bcm2835" ]; + boot.loader.raspberryPi.version = 4; + + hardware.raspberry-pi."4" = { + fkms-3d.enable = true; + apply-overlays-dtmerge.enable = true; + }; + console.enable = false; + environment.systemPackages = with pkgs; [ + libraspberrypi + raspberrypi-eeprom + ]; networking.hostName = "orange"; }