Building a NixOS ISO on MacOS

Hi! :wave:

I’m trying to build a NixOS ISO image with unfree firmware to install on my x86_64 iMac.
I’m following this guide to set up a remote worker running x86_64 linux and this suggests that this part works:

➜  nix build --impure --expr '(with import <nixpkgs> { system = "x86_64-linux"; }; runCommand "foo" {} "uname -a > $out")'
➜  cat result
Linux localhost 6.6.37 #1-NixOS SMP PREEMPT_DYNAMIC Fri Jul  5 07:34:07 UTC 2024 x86_64 GNU/Linux

However, when I try to build an ISO from this flake:

{
  description = "Minimal NixOS installation media";
  inputs.nixos.url = "nixpkgs/24.05";
  outputs = { self, nixos }: {
    nixosConfigurations = {
      exampleIso = nixos.lib.nixosSystem {
        system = "x86_64-linux";
        modules = [
          "${nixos}/nixos/modules/installer/cd-dvd/installation-cd-graphical-gnome.nix"
          ({ config, pkgs, ... }: {
            nixpkgs.bonfig.allowUnfree = true;
            boot.initrd.kernelModules = [ "wl" ];
            boot.kernelModules = [ "kvm-intel" "wl" ];
            boot.extraModulePackages = [ config.boot.kernelPackages.broadcom_sta ];
            environment.systemPackages = [ pkgs.vim pkgs.git ];
          })
        ];
      };
    };
  };
}

I’m getting this error:

➜  nix build --impure --store $PWD/tmpstore --no-eval-cache --no-substitute .#nixosConfigurations.exampleIso.config.system.build.isoImage --builders 'ssh://localhost x86_64-linux'
error:
       … while updating the lock file of flake 'path:/Users/<user>/workspace/nixos/build?lastModified=0&narHash=sha256-mS9dKXtnGHWttwfC7AIlh1oyVd2FlmT6rkxasmUXhsg%3D'

       … while updating the flake input 'nixos'

       … while fetching the input 'github:NixOS/nixpkgs/24.05'

       error: 'lastModified' attribute mismatch in input 'github:NixOS/nixpkgs/63dacb46bf939521bdc93981b4cbb7ecb58427a0?narHash=sha256-vboIEwIQojofItm2xGCdZCzW96U85l9nDW3ifMuAIdM%3D', expected 1720781449

I’m honestly not sure what I can try next, I haven’t build up a good intuition how nix and flakes work at all, although I ran NixOS in the past for some years.
Any help or pointers would be appreciated!

For reference, my /etc/nix/nix.conf:

build-users-group = nixbld
trusted-users = root <user>
extra-trusted-users = root <user>
builders = ssh-ng://builder@linux-builder x86_64-linux /etc/nix/builder_ed25519 4 - - - <…>
builders-use-substitutes = true

Your input url should use nixos-24.05 not 24.05 - at least that’s the first thing I notice. Also (side note) I’m shocked to see flakes in the nixpkgs manual.

Also did you run nix flake update?