Files
Cryolitia PukNgae 11cefffd51 raspberry-pi/1: Add Raspberry Pi 1 support
The Raspberry Pi SD installer remains in nixpkgs, but its
sd-image-raspberrypi.nix configuration still selects
linuxKernel.packages.linux_rpi1. Commit b1c58b82b98f ("linux-rpi*: remove")
removed that kernel from nixpkgs, leaving the installer unable to
evaluate. Move the Pi 1 image configuration to nixos-hardware alongside
the vendor kernel.

The shared vendor kernel builder accepts rpiVersion = 1, but there is no
corresponding board profile. Add an ARMv6 profile with 32-bit U-Boot and
the shared firmware installer. Use the legacy boot and initrd settings
without the graphics defaults for newer boards. Provide SD-image and
installer modules adapted from the nixpkgs image, and exclude the
profile from checks without ARMv6 coverage.

The image has been cross-compiled but has not been tested on a board, as
no Pi 1 hardware was available.

Link: https://github.com/NixOS/nixpkgs/blob/b1c58b82b98ff287751c78ee2b96dc5c4384e3b3/nixos/modules/installer/sd-card/sd-image-raspberrypi.nix#L20
Link: https://github.com/NixOS/nixpkgs/commit/b1c58b82b98ff287751c78ee2b96dc5c4384e3b3
Signed-off-by: Cryolitia PukNgae <cryolitia@mercallure.com>
2026-10-19 16:01:58 +08:00

78 lines
1.7 KiB
Nix

{
self,
privateInputs,
system,
pkgs,
}:
let
# Hardware profile checks
blackList = [
# does import-from-derivation
"toshiba-swanky"
# ARMv6 is not covered by the test platforms
"raspberry-pi-1"
# uses custom nixpkgs config
"raspberry-pi-2"
# deprecated profiles
"framework"
"asus-zephyrus-ga402x"
"lenovo-yoga-7-14ARH7"
];
aarch64Systems = [
"raspberry-pi-3"
"raspberry-pi-4"
"raspberry-pi-5"
"nxp-imx8mp-evk"
"nxp-imx8mq-evk"
"nxp-imx8qm-mek"
"nxp-imx93-evk"
"ucm-imx95"
];
matchArch =
moduleName:
if builtins.elem moduleName aarch64Systems then
system == "aarch64-linux"
else
# TODO also add riscv64
system == "x86_64-linux";
modules = pkgs.lib.filterAttrs (
name: _: !(builtins.elem name blackList || pkgs.lib.hasPrefix "common-" name) && matchArch name
) self.nixosModules;
buildProfile = import ./build-profile.nix;
unfreeNixpkgs = {
config = {
allowBroken = true;
allowUnfree = true;
nvidia.acceptLicense = true;
};
overlays = [ ];
inherit system;
};
nixpkgsUnstable = import privateInputs.nixos-unstable-small unfreeNixpkgs;
nixpkgsStable = import privateInputs.nixos-stable unfreeNixpkgs;
# Build checks for both unstable and stable
unstableChecks = pkgs.lib.mapAttrs' (
name: module:
pkgs.lib.nameValuePair "unstable-${name}" (buildProfile {
pkgs = nixpkgsUnstable;
profile = module;
})
) modules;
stableChecks = pkgs.lib.mapAttrs' (
name: module:
pkgs.lib.nameValuePair "stable-${name}" (buildProfile {
pkgs = nixpkgsStable;
profile = module;
})
) modules;
in
unstableChecks // stableChecks