1
1
mirror of https://github.com/NixOS/mobile-nixos.git synced 2024-12-15 02:43:24 +03:00
mobile-nixos/modules/initrd-firmware.nix
Samuel Dionne-Riel d9cd7b336b initrd-firmware: Init module to add firmware to stage-1
Much better than the ad-hoc way used in a previous PR
2020-06-01 18:58:59 -04:00

33 lines
715 B
Nix

{ pkgs, lib, config, ... }:
let
inherit (lib) types;
inherit (config.mobile.boot.stage-1) firmware;
in
{
options = {
mobile.boot.stage-1.firmware = lib.mkOption {
type = types.listOf types.package;
default = [];
description = ''
List of packages containing firmware files to be included in the
stage-1 for the device.
'';
apply = list: pkgs.buildEnv {
name = "firmware";
paths = list;
pathsToLink = [ "/lib/firmware" ];
ignoreCollisions = true;
};
};
};
config = {
mobile.boot.stage-1.contents = [
{
object = "${firmware}/lib/firmware";
symlink = "/lib/firmware";
}
];
};
}