pin kernel

This commit is contained in:
Travis Staton 2024-05-11 14:14:57 -04:00
parent b39b556e8a
commit 8fc9cbd3e4
2 changed files with 26 additions and 11 deletions

View file

@ -2,6 +2,7 @@
description = "raspberry-pi nixos configuration";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/9a9960b98418f8c385f52de3b09a63f9c561427a";
u-boot-src = {
flake = false;
url = "https://ftp.denx.de/pub/u-boot/u-boot-2024.01.tar.bz2";
@ -36,14 +37,25 @@
};
};
outputs = srcs@{ self, ... }: {
overlays = {
core = import ./overlays (builtins.removeAttrs srcs [ "self" ]);
libcamera = import ./overlays/libcamera.nix (builtins.removeAttrs srcs [ "self" ]);
outputs = srcs@{ self, ... }:
let
pinned = import nixpkgs {
system = "aarch64-linux";
overlays = with self.overlays; [ core libcamera ];
};
in
{
overlays = {
core = import ./overlays (builtins.removeAttrs srcs [ "self" ]);
libcamera = import ./overlays/libcamera.nix (builtins.removeAttrs srcs [ "self" ]);
};
nixosModules.raspberry-pi = import ./rpi {
inherit pinned;
core-overlay = self.overlays.core;
libcamera-overlay = self.overlays.libcamera;
};
packages.aarch64-linux = {
linux = pinned.rpi-kernels.latest.kernel;
};
};
nixosModules.raspberry-pi = import ./rpi {
core-overlay = self.overlays.core;
libcamera-overlay = self.overlays.libcamera;
};
};
}

View file

@ -1,4 +1,4 @@
{ core-overlay, libcamera-overlay }:
{ pinned, core-overlay, libcamera-overlay }:
{ lib, pkgs, config, ... }:
let cfg = config.raspberry-pi-nix;
@ -272,7 +272,10 @@ in
"pcie_brcmstb" # required for the pcie bus to work
"reset-raspberrypi" # required for vl805 firmware to load
];
kernelPackages = pkgs.linuxPackagesFor (pkgs.rpi-kernels.latest.kernel);
# This pin is not necessary, it would be fine to replace it with
# `pkgs.rpi-kernels.latest.kernel`. It is helpful to ensure
# cache hits for kernel builds though.
kernelPackages = pinned.linuxPackagesFor (pinned.rpi-kernels.latest.kernel);
loader = {
grub.enable = lib.mkDefault false;