Let’s go a step further, and start using guix deploy. This way, I don’t have
to quit my laptop to deploy a new version of the server. The way it works: you
build the system locally, you create an archive, you send the archive to the
server, where it is extracted, then installed. All of it is done in a simple
guix deploy.
guix deploy takes a file that describes a list of machines, one in my case.
(define-module (machines tuziwo)
#:use-module (gnu machine)
#:use-module (gnu machine ssh)
#:use-module (operating-systems tuziwo)
#:use-module (guix))
(define tuziwo-machine-ssh-configuration
(machine-ssh-configuration (host-name "tuziwo.info")
(host-key
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIB4CV6nerE3fDhYaypmLFJ+P9pwA6ra5fC5bfMw2HRX+")
(system "x86_64-linux")
(user "woshilapin")
(identity
"/home/woshilapin/.ssh/woshilapin@gmail.com.rsa")
(port 22)))
(define tuziwo-machine
(machine (operating-system
tuziwo)
(environment managed-host-environment-type)
(configuration tuziwo-machine-ssh-configuration)))
(list tuziwo-machine)
Then you just need to guix deploy --load-path=$PWD machines/tuziwo.scm. Note
however that this deployment doesn’t restart the machine, nor the services. You
can then guix deploy --load-path=$PWD machines/tuziwo.scm --execute — sudo
reboot --kexec to reboot the entire machine, or with herd restart ssh to only
restart a specific service.
I’m pretty happy with this new setup, compared to the old one that was docker
only, with an Apache in front.