Development vm on MacOS

With the below configuration in flake.nix, people who use MacOS would not be able to execute the command nix run .#dev-vm, is that right? And if so, how could I adjust this config to allow that?

packages = {
      x86_64-linux.dev-vm = self.nixosConfigurations.dev-vm.config.system.build.vm;
    };
    nixosConfigurations = {
      dev-vm = nixpkgs.lib.nixosSystem {
        modules = [
          ./dev-vm
        ];
      };
    };

Correct. You are defining dev-vm as a package for x86_64-linux only. You need to add aarch64-darwin.dev-vm = ... to your packages.

what about aarch64-linux and x86_64-darwin?

Whatever target platform you need. You might want to use flake-utils to generate those.

Mind that you also might need suitable (remote) builders and the target must be supported by QEMU.

I do not think I need remote builders, I think as long as the user uses Windows (WSL2), MacOS or any Linux distribution, this virtual machine runs fine. And that is like 99% of people.