I’m trying to build an SD image of NixOS for my Raspberry Pi Pico W. The machine’s architecture is armv6l-linux
and my approach is to cross-compile from x86_64-linux
. Here’s my flake from NixOS on ARM - NixOS Wiki
{
description = "Build image";
inputs.nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
outputs = { self, nixpkgs }: let
system = "armv6l-linux";
pkgs = nixpkgs.legacyPackages.${system};
in rec {
nixosConfigurations.rpizw = nixpkgs.lib.nixosSystem {
modules = [
"${nixpkgs}/nixos/modules/installer/sd-card/sd-image-raspberrypi.nix"
{
nixpkgs.config.allowUnsupportedSystem = true;
nixpkgs.hostPlatform.system = system;
nixpkgs.buildPlatform.system = "x86_64-linux"; #If you build on x86 other wise changes this.
nixpkgs.overlays = [
(self: super: {
# https://github.com/rhboot/efivar/issues/270
# I don't need efivar, I think.
efivar = pkgs.runCommand "empty-efivar" { } "mkdir -p $out";
efibootmgr = pkgs.runCommand "empty-efibootmgr" { } "mkdir -p $out";
})
];
}
];
};
images.rpizw = nixosConfigurations.rpizw.config.system.build.sdImage;
};
}
The build (nix build .#images.rpizw
) cannot get pass bootstrap-tools
:
error: '/nix/store/n3ds4hlxnbp6fwc0l90f4ygakakcchlw-bootstrap-tools.drv': build not possible: unknown system: armv6l-linux
I tried with pinning nixpkgs to nixos-24.11
but I get the same error.
What’s the problem here, and is there a way to solve this? Thanks in advance!