I'd like the ability to deploy to a remote Mac machine (say, a Mac mini server) from another Mac machine (say, a Macbook). nixinate is currently hardcoded to deploy nixosConfigurations.foo using nixos-rebuild. To support macOS, we simply want to be able to deploy darwinConfigurations.foo using darwin-rebuild; everything else would more or less remain the same. Here's a demonstration of what this looks like without nixinate:
apps.aarch64-darwin.deploy-macmini = {
type = "app";
program =
let
host = "user@192.52.31.40";
machine = "myhost";
pkgs = inputs.nixpkgs.legacyPackages.aarch64-darwin;
in
(pkgs.writeShellApplication {
name = "deploy-to-mac";
text = ''
set -x
nix copy ${self} --to ssh://${host}
ssh -t ${host} "darwin-rebuild switch --flake ${self}#${machine}"
'';
}) + "/bin/deploy-to-mac";
};
I'd like the ability to deploy to a remote Mac machine (say, a Mac mini server) from another Mac machine (say, a Macbook). nixinate is currently hardcoded to deploy
nixosConfigurations.foousingnixos-rebuild. To support macOS, we simply want to be able to deploydarwinConfigurations.foousingdarwin-rebuild; everything else would more or less remain the same. Here's a demonstration of what this looks like without nixinate: