Skip to content

Commit

Permalink
add pin-kernel option
Browse files Browse the repository at this point in the history
  • Loading branch information
tstat committed May 14, 2024
1 parent e858a13 commit bacb0f1
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion rpi/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,15 @@ in

options = with lib; {
raspberry-pi-nix = {
pin-kernel = {
enable = mkOption {
default = true;
type = types.bool;
description = ''
Whether to pin the kernel to the latest cachix build.
'';
};
};
firmware-migration-service = {
enable = mkOption {
default = true;
Expand Down Expand Up @@ -275,7 +284,10 @@ in
# 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);
kernelPackages =
if cfg.pin-kernel.enable
then pinned.linuxPackagesFor (pinned.rpi-kernels.latest.kernel)
else pkgs.linuxPackagesFor (pkgs.rpi-kernels.latest.kernel);

loader = {
grub.enable = lib.mkDefault false;
Expand Down

0 comments on commit bacb0f1

Please sign in to comment.