I’m trying to generate a NixOS configuration for a Raspberry Pi Zero 2 that has an SD card image. Here’s the configuration:
{ lib, pkgs, ... }:
let
inherit (lib) mkForce;
in
{
imports = [ "${pkgs}/nixos/modules/installer/sd-card/sd-image-raspberrypi.nix" ];
time.timeZone = "America/Los_Angeles";
services = {
openssh.enable = true;
octoprint.enable = true;
};
networking.useDHCP = true;
boot = {
kernelPackages = mkForce pkgs.linuxPackages_latest;
supportedFilesystems = {
# ZFS is broken on the latest kernel for aarch64
zfs = lib.mkForce false;
};
};
# https://wiki.nixos.org/wiki/FAQ/When_do_I_update_stateVersion
system.stateVersion = "23.11";
}
I try to build the SD card image with this:
$ nix build .#nixosConfigurations.nestor.config.system.build.sdImage
I end up getting this error though:
error:
… while evaluating 'strict' to select 'drvPath' on it
at /builtin/derivation.nix:1:552:
… while calling the 'derivationStrict' builtin
at /builtin/derivation.nix:1:208:
(stack trace truncated; use '--show-trace' to show the full trace)
error: Package ‘uboot-rpi_0_w_defconfig-2025.01’ in /nix/store/xq5rfjj1z2r8yx338arajg5vwsxh1fri-source/pkgs/misc/uboot/default.nix:136 is not available on the requested hostPlatform:
hostPlatform.config = "aarch64-unknown-linux-gnu"
package.meta.platforms = [
"armv6l-linux"
]
package.meta.badPlatforms = [ ]
, refusing to evaluate.
a) To temporarily allow packages that are unsupported for this system, you can use an environment variable
for a single invocation of the nix tools.
$ export NIXPKGS_ALLOW_UNSUPPORTED_SYSTEM=1
Note: When using `nix shell`, `nix build`, `nix develop`, etc with a flake,
then pass `--impure` in order to allow use of environment variables.
b) For `nixos-rebuild` you can set
{ nixpkgs.config.allowUnsupportedSystem = true; }
in configuration.nix to override this.
c) For `nix-env`, `nix-build`, `nix-shell` or any other Nix command you can add
{ allowUnsupportedSystem = true; }
to ~/.config/nixpkgs/config.nix.
How can I fix with this without allowing the unsupported system?
I’m on this nixpkgs commit: Revert "calamares: 3.3.13 -> 3.3.14" (#387517) · NixOS/nixpkgs@10069ef · GitHub