-
Notifications
You must be signed in to change notification settings - Fork 1
/
sd-image.nix
35 lines (32 loc) · 986 Bytes
/
sd-image.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
{ config, pkgs, lib, modulesPath, ... }:
{
imports = [
"${modulesPath}/profiles/base.nix"
"${modulesPath}/installer/sd-card/sd-image.nix"
./nixos.nix
];
disabledModules = [ "${modulesPath}/profiles/all-hardware.nix" ];
config = {
sdImage = {
# Depending on the FSBL setup, BOOT.BIN can be quite large
firmwareSize = 100;
populateFirmwareCommands = ''
cp ${config.hardware.zynq.boot-bin} firmware/BOOT.BIN
'';
populateRootCommands = ''
mkdir -p ./files/boot
${config.boot.loader.generic-extlinux-compatible.populateCmd} -c ${config.system.build.toplevel} -d ./files/boot
'';
};
environment.systemPackages = [
(pkgs.writeShellApplication {
name = "xlnx-firmware-update";
text = ''
systemctl start boot-firmware.mount
cp ${config.hardware.zynq.boot-bin} /boot/firmware/BOOT.BIN
sync /boot/firmware/BOOT.BIN
'';
})
];
};
}