1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-12-25 03:17:13 +00:00
nixpkgs/nixos/modules/system/boot/loader/raspberrypi/raspberrypi.nix
Ricardo M. Correia c19b17d14f raspberryPi boot loader: fix booting Raspberry Pi 3
The Raspberry Pi 3 seems to need the .DTB file when booting the kernel,
so we must copy it to /boot when installing a new kernel.
2017-02-12 02:48:57 +02:00

49 lines
1 KiB
Nix

{ config, lib, pkgs, ... }:
with lib;
let
cfg = config.boot.loader.raspberryPi;
builder = pkgs.substituteAll {
src = ./builder.sh;
isExecutable = true;
inherit (pkgs) bash;
path = [pkgs.coreutils pkgs.gnused pkgs.gnugrep];
firmware = pkgs.raspberrypifw;
version = cfg.version;
};
platform = pkgs.stdenv.platform;
in
{
options = {
boot.loader.raspberryPi.enable = mkOption {
default = false;
type = types.bool;
description = ''
Whether to create files with the system generations in
<literal>/boot</literal>.
<literal>/boot/old</literal> will hold files from old generations.
'';
};
boot.loader.raspberryPi.version = mkOption {
default = 2;
type = types.enum [ 1 2 3 ];
description = ''
'';
};
};
config = mkIf config.boot.loader.raspberryPi.enable {
system.build.installBootLoader = builder;
system.boot.loader.id = "raspberrypi";
system.boot.loader.kernelFile = platform.kernelTarget;
};
}