uboot: (firmwareOdroidC2/C4) don't invoke patch tool, use patches = [] instead
https://github.com/NixOS/nixpkgs/blob/master/pkgs/stdenv/generic/setup.sh#L948 this can do it nicely. Signed-off-by: Anton Arapov <anton@deadbeef.mx>
This commit is contained in:
commit
56de2bcd43
30691 changed files with 3076956 additions and 0 deletions
64
nixos/modules/system/boot/loader/grub/ipxe.nix
Normal file
64
nixos/modules/system/boot/loader/grub/ipxe.nix
Normal file
|
|
@ -0,0 +1,64 @@
|
|||
# This module adds a scripted iPXE entry to the GRUB boot menu.
|
||||
|
||||
{ config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
scripts = builtins.attrNames config.boot.loader.grub.ipxe;
|
||||
|
||||
grubEntry = name:
|
||||
''
|
||||
menuentry "iPXE - ${name}" {
|
||||
linux16 @bootRoot@/ipxe.lkrn
|
||||
initrd16 @bootRoot@/${name}.ipxe
|
||||
}
|
||||
|
||||
'';
|
||||
|
||||
scriptFile = name:
|
||||
let
|
||||
value = builtins.getAttr name config.boot.loader.grub.ipxe;
|
||||
in
|
||||
if builtins.typeOf value == "path" then value
|
||||
else builtins.toFile "${name}.ipxe" value;
|
||||
in
|
||||
{
|
||||
options =
|
||||
{ boot.loader.grub.ipxe = mkOption {
|
||||
type = types.attrsOf (types.either types.path types.str);
|
||||
description =
|
||||
''
|
||||
Set of iPXE scripts available for
|
||||
booting from the GRUB boot menu.
|
||||
'';
|
||||
default = { };
|
||||
example = literalExpression ''
|
||||
{ demo = '''
|
||||
#!ipxe
|
||||
dhcp
|
||||
chain http://boot.ipxe.org/demo/boot.php
|
||||
''';
|
||||
}
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf (builtins.length scripts != 0) {
|
||||
|
||||
boot.loader.grub.extraEntries =
|
||||
if config.boot.loader.grub.version == 2 then
|
||||
toString (map grubEntry scripts)
|
||||
else
|
||||
throw "iPXE is not supported with GRUB 1.";
|
||||
|
||||
boot.loader.grub.extraFiles =
|
||||
{ "ipxe.lkrn" = "${pkgs.ipxe}/ipxe.lkrn"; }
|
||||
//
|
||||
builtins.listToAttrs ( map
|
||||
(name: { name = name+".ipxe"; value = scriptFile name; })
|
||||
scripts
|
||||
);
|
||||
};
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue