nixos-rebuild switch --build-host root@mandalore --target-host root@mandalore --flake ".#mandalore"
nixos-rebuild switch --target-host root@scarif --flake ".#scarif"
sudo nixos-rebuild switch --flake .#<HOSTNAME>
ssh root@<IP> -p 2222
Don't forget to specify root as username when connecting to the initrd ssh session!
To view the logs of the podman containers specified in the nix config, use the following command:
# show containers
sudo podman ps -a
# show logs for container
sudo podman logs -f <CONTAINER_ID>
# testing the backup
systemctl start restic-backups-paperless.service
systemctl stop paperless-consumer.service paperless-scheduler.service paperless-task-queue.service paperless-web.service redis-paperless.service
sudo rm -rf /var/lib/paperless
update-switch
# create a repo on the server
sudo -u git bash -c "git init --bare ~/myproject.git"
# then you can use it via the following url
git@git.hoenle.xyz:myproject.git
# running the backup job
systemctl start restic-backups-fileserver.service
# restoring from backup
sudo -u fileserver /run/current-system/sw/bin/restic-fileserver restore --target / latest
- In case of systemd temp files and directories not created properly when testing backups, run
sudo systemd-tmpfiles --create
on the server.