2014-04-14 16:26:48 +02:00
|
|
|
{ config, lib, pkgs, ... }:
|
2013-01-28 21:58:46 +01:00
|
|
|
|
2014-04-14 16:26:48 +02:00
|
|
|
with lib;
|
2013-01-28 21:58:46 +01:00
|
|
|
|
|
|
|
let
|
2013-09-04 13:05:09 +02:00
|
|
|
|
2013-01-28 21:58:46 +01:00
|
|
|
builder = pkgs.substituteAll {
|
|
|
|
src = ./builder.sh;
|
|
|
|
isExecutable = true;
|
|
|
|
inherit (pkgs) bash;
|
|
|
|
path = [pkgs.coreutils pkgs.gnused pkgs.gnugrep];
|
|
|
|
firmware = pkgs.raspberrypifw;
|
|
|
|
};
|
|
|
|
|
|
|
|
platform = pkgs.stdenv.platform;
|
2013-09-04 13:05:09 +02:00
|
|
|
|
2013-01-28 21:58:46 +01:00
|
|
|
in
|
2013-09-04 13:05:09 +02:00
|
|
|
|
2013-01-28 21:58:46 +01:00
|
|
|
{
|
2013-09-04 13:05:09 +02:00
|
|
|
options = {
|
2013-01-28 21:58:46 +01:00
|
|
|
|
2013-09-04 13:05:09 +02:00
|
|
|
boot.loader.raspberryPi.enable = mkOption {
|
|
|
|
default = false;
|
|
|
|
description = ''
|
|
|
|
Whether to create files with the system generations in
|
|
|
|
<literal>/boot</literal>.
|
|
|
|
<literal>/boot/old</literal> will hold files from old generations.
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
|
|
|
};
|
2013-01-28 21:58:46 +01:00
|
|
|
|
2013-09-04 13:05:09 +02:00
|
|
|
config = mkIf config.boot.loader.raspberryPi.enable {
|
|
|
|
system.build.installBootLoader = builder;
|
|
|
|
system.boot.loader.id = "raspberrypi";
|
|
|
|
system.boot.loader.kernelFile = platform.kernelTarget;
|
2013-01-28 21:58:46 +01:00
|
|
|
};
|
|
|
|
}
|