mirror of
https://github.com/NixOS/mobile-nixos.git
synced 2024-12-15 19:23:01 +03:00
d9cd7b336b
Much better than the ad-hoc way used in a previous PR
33 lines
715 B
Nix
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";
|
|
}
|
|
];
|
|
};
|
|
}
|