After living in a love-hate relationship with my nixos-configuration it finally came to the point that it became too big of a file to handle. I already had it versioned (nearly everything I write is versioned). But now the file approached a few hundred lines at I was going to loose my grip on it. A few hundred lines of code is nothing. But a few hundred lines of config is a whole lot.
I want to get a directory backed up with borg on my nixos-server (regulus.fritz.box). The client may just be a regular unixoid, doesn't have to be nixos (I am using MacOS for testing). All the commands (unless explicitly stated otherwise) are executed on the client. Both systems have borg installed. This is a tutorial, so most explaining will be about what to do, not why to do it.
I am currently rewriting the Chris Wellons’s racing simulation in rust as a training exercise. His program is really nice in that it is visual, interesting and well under 500 lines of Code - really inspiring (I wouldn’t have minded speaking variable names and comments though). Rust is still hard for me, I am mostly fighting the borrow checker. But the extremely helpfully error-messages and Stackoverflow mostly help me get over it.
Nix is packagemanager like nothing I have seen anywhere else (I have suspicion that Guix goes in a similar direction, but I haven’t tried it out yet). Using it is a bit similar to using a package manager for the first time: Once you have seen the light, there is no coming back. That’s why I have Nix running on 3 machines currently: My main Laptop, my “home-server”-raspberry-pi and (since this weeks) my MacBook for work (I am in the happy situation that my current employer allows devs much freedom on their work-devices).
Given a raspberry pi 4 with an ethernet connection a micro-sd card a usb-keyboard … this is how to set up the RP with nixos so that you can ssh into it. We won't need to attach a screen to it. All we need beyond above is a computer with an internet connection that can write to the SD card (using dd).
When I want to do something for fun, this is what I do: Plan it (find a date and time, ask people I want to participate) Prepare it (pack the necessary stuff, drive there, set up the table/workspace) Do it Clean up (drive home, put everything back, remove tmp-files) Now that I think about it, the workflow is pretty similar to what I do when I want to work on something not for fun.