Can I get something like nixos-anywhere on the Pi?

I’ve discovered the most satisfying way of getting stations up and running with NixOS.

  1. Boot an ISO I’ve built with SSH keys already installed
  2. nixos-anywhere, to install an initial NixOS
  3. nixos-rebuild, with my flake.

All done from the comfort of my velvet armchair. Only thing missing in this setup is something like the PiKVM, where I can emulate USB drives. Then I don’t even need to get up to insert or pull out the Live USB stick and the storage USB stick;)

Anyways, nixos-anywhere depends on x86, it seems, so, it’s not really anywhere;)

Does a workflow like this exist for Pi?

There’s GitHub - MatthewCroughan/raspberrypi-nixos-example: The simplest possible way to begin using and extending a NixOS Configuration with a Raspberry Pi if you’re interested in making an SD Image. Then a deployment script might look like

deploy = pkgs.writeScriptBin "" ''
  nix copy ${} --to ssh://user@pi.local
  ssh -t user@pi.local 'sudo nix-env -p /nix/var/nix/profiles/system --set ${}'
  ssh -t user@pi.local 'sudo ${}/bin/switch-to-configuration switch'

I don’t think it’s relevant to Pi itself, you’re looking at deploying your configuration to running hosts?
Consider that a Pi may not have sufficient resources to run nixos-rebuild or would be quite slow and so shipping an already built image may be “more efficient”.

nixos-anywhere will still require some manual process either by manually booting an USB with NixOS installer or setting up network boot (Network Boot With Raspberry Pi: Everything you need to know – RaspberryTips):

nixops may be more suitable for your use case as it lets you manage configurations on existing / running NixOS hosts:

nixos-rebuild supports --build-host ; isn’t that for building locally, then deploying remotely?

Isn’t that exactly what nixos-rebuild remote does? Any advantage in using nixops?

I believe both nixos-anywhere and nixops could do the job
Solutions like nixops are more devops oriented / focus

Here’s a list of tools that could tackle your use case: Looking for alternative to NixOps - #3 by Janik

Not sure what you mean here, cause nixos-anywhere doesn’t work on Pi.