Instead of copying via rsync, it would be cleaner to deploy using nix flake archive.
This would place the flake and it's inputs in the remote's nix store and return the path when using --json
For example:
❯ nix flake archive --to ssh://root@kfbox.public --option builders-use-substituters true --json
warning: Git tree '/home/pinpox/code/github.com/pinpox/nixos' is dirty
{"inputs":{"snip": "..." },"path":"/nix/store/78vb5imcxk2rla6s13av8vdm5n3rp49m-source"}
To rebuild we would need to know that path. A possible solution would be to create a link to the path in the store in the location where the flake was deployed until now. e.g.:
Instead of copying via rsync, it would be cleaner to deploy using
nix flake archive
. This would place the flake and it's inputs in the remote's nix store and return the path when using--json
For example:
To rebuild we would need to know that path. A possible solution would be to create a link to the path in the store in the location where the flake was deployed until now. e.g.:
This way, we could the always rebuild like normal by running `nixos-rebuild switch --flake '/var/lib/lollypops/flake'
Idea is shamelessly stolen from here