2023-06-12 17:07:38 +07:00
|
|
|
{ pkgs
|
2024-05-17 19:38:57 +07:00
|
|
|
, pkgs-kernel
|
2023-06-12 17:07:38 +07:00
|
|
|
, config
|
|
|
|
, ... }:
|
|
|
|
|
|
|
|
{
|
|
|
|
boot.loader = {
|
|
|
|
grub.enable = false;
|
|
|
|
generic-extlinux-compatible.enable = true;
|
|
|
|
};
|
|
|
|
|
2024-08-15 09:06:06 +07:00
|
|
|
boot.kernelPackages = pkgs-kernel.linuxPackagesFor pkgs-kernel.hw.bpi-r3.linux;
|
2023-06-12 17:07:38 +07:00
|
|
|
|
|
|
|
hardware.deviceTree.enable = true;
|
|
|
|
hardware.deviceTree.filter = "mt7986a-bananapi-bpi-r3.dtb";
|
|
|
|
hardware.enableRedistributableFirmware = true;
|
2023-06-14 17:26:54 +07:00
|
|
|
hardware.deviceTree.overlays = [
|
|
|
|
{
|
|
|
|
name = "mt7986a-bananapi-bpi-r3-wireless.dts";
|
|
|
|
dtsFile = ./mt7986a-bananapi-bpi-r3-wireless.dts;
|
|
|
|
}
|
|
|
|
];
|
2023-06-12 17:07:38 +07:00
|
|
|
|
|
|
|
# # disable a bunch of useless drivers
|
|
|
|
# boot.initrd.includeDefaultModules = false;
|
|
|
|
boot.initrd.availableKernelModules = [ "mmc_block" "dm_mod" "rfkill" "cfg80211" "mt7915e" ];
|
|
|
|
boot.kernelParams = [ "boot.shell_on_fail" "console=ttyS0,115200" ];
|
|
|
|
|
|
|
|
boot.initrd.compressor = "zstd";
|
|
|
|
|
|
|
|
system.build.rootfsImage = pkgs.callPackage "${pkgs.path}/nixos/lib/make-ext4-fs.nix" {
|
|
|
|
storePaths = config.system.build.toplevel;
|
|
|
|
compressImage = false;
|
|
|
|
volumeLabel = "NIX_ROOTFS";
|
|
|
|
};
|
|
|
|
|
|
|
|
boot.postBootCommands = ''
|
|
|
|
if [ -f ${toString config.impermanence.path}/nix-path-registration ]; then
|
|
|
|
${config.nix.package.out}/bin/nix-store --load-db < ${toString config.impermanence.path}/nix-path-registration
|
|
|
|
mkdir -p /etc
|
|
|
|
touch /etc/NIXOS
|
|
|
|
${config.nix.package.out}/bin/nix-env -p /nix/var/nix/profiles/system --set /run/current-system
|
|
|
|
rm -f ${toString config.impermanence.path}/nix-path-registration
|
|
|
|
fi
|
|
|
|
'';
|
|
|
|
|
|
|
|
hardware.wirelessRegulatoryDatabase = true;
|
|
|
|
}
|