79 lines
2.1 KiB
Nix
79 lines
2.1 KiB
Nix
{ config, lib, pkgs, modulesPath, ... }:
|
|
|
|
let
|
|
extlinux-conf-builder =
|
|
import "${modulesPath}/system/boot/loader/generic-extlinux-compatible/extlinux-conf-builder.nix" {
|
|
pkgs = pkgs.buildPackages;
|
|
};
|
|
bootfiles = builtins.path {
|
|
path = ../bootfiles;
|
|
name = "brain-bootfiles";
|
|
};
|
|
in
|
|
{
|
|
imports = [
|
|
"${modulesPath}/profiles/base.nix"
|
|
"${modulesPath}/profiles/installation-device.nix"
|
|
"${modulesPath}/installer/cd-dvd/sd-image.nix"
|
|
];
|
|
|
|
nixpkgs.crossSystem = import ./platform.nix { inherit lib; };
|
|
nixpkgs.overlays = [
|
|
(import ./overlays/llvm-tablegen.nix)
|
|
];
|
|
|
|
boot.loader.grub.enable = false;
|
|
boot.loader.generic-extlinux-compatible.enable = true;
|
|
|
|
boot.kernelPackages = pkgs.linuxPackagesFor (import ./brain-kernel.nix { inherit pkgs; });
|
|
boot.kernelPatches = [];
|
|
|
|
hardware.deviceTree.enable = true;
|
|
hardware.firmware = lib.mkForce (
|
|
with pkgs; [
|
|
firmwareLinuxNonfree
|
|
intel2200BGFirmware
|
|
rtl8192su-firmware
|
|
rt5677-firmware
|
|
rtl8723bs-firmware
|
|
rtlwifi_new-firmware
|
|
zd1211fw
|
|
# alsa-firmware builds a host tool (tobin) that runs during build.
|
|
buildPackages.alsa-firmware
|
|
openelec-dvb-firmware
|
|
]
|
|
++ lib.optional (pkgs.stdenv.hostPlatform.isAarch32 || pkgs.stdenv.hostPlatform.isAarch64)
|
|
raspberrypiWirelessFirmware
|
|
++ lib.optionals (lib.versionOlder config.boot.kernelPackages.kernel.version "4.13") [
|
|
rtl8723bs-firmware
|
|
]
|
|
);
|
|
|
|
boot.kernelParams = [
|
|
"console=ttyAMA0,115200n8"
|
|
"console=tty1"
|
|
"rootwait"
|
|
"fbcon=font:ProFont6x11"
|
|
];
|
|
|
|
networking.hostName = "brain";
|
|
networking.useDHCP = true;
|
|
services.openssh.enable = true;
|
|
|
|
system.stateVersion = "20.03";
|
|
|
|
sdImage = {
|
|
imageBaseName = "brain-nixos";
|
|
firmwareSize = 64;
|
|
|
|
populateFirmwareCommands = ''
|
|
# Copy Windows CE boot assets (BrainLILO, u-boot loader, etc.)
|
|
cp -R ${bootfiles}/. firmware/
|
|
'';
|
|
|
|
populateRootCommands = ''
|
|
mkdir -p ./files/boot
|
|
${extlinux-conf-builder} -t 3 -c ${config.system.build.toplevel} -d ./files/boot
|
|
'';
|
|
};
|
|
}
|