levr/content/posts/homelab-apprentissage-dur.en.md

40 lines
2.4 KiB
Markdown
Raw Normal View History

2025-09-30 04:42:58 +02:00
+++
date = '2025-09-29T20:13:40+02:00'
draft = false
tags = [ "nixos", "self-hosting" ]
title = 'Homelab: Learning the hard way'
+++
Spending the weekend with family, I took the chance to check whether I could still access my various sites and services from outside. Feeling pretty good after that success, I thought—why not set up rtorrent through ProtonVPN on the server?
## The Beginning of the Screw-ups
Naturally, it wasnt going to be straightforward. Natively, its already messy, but with NixOS? Utter chaos. So I turned to an AI, hoping for some explanations, and started blindly pasting random commands it spit out whenever an error showed up. Of course, nothing ever worked, and even worse, I had no clue what I was actually doing. In situations like that, you can smell disaster coming a mile away.
And sure enough—thats exactly what happened! Boom, the whole network broke. No more outside access, sites and services down, just the big blank page of doom.
No problem, I thought—lets just ssh in and fix the mess… except, nope, I had closed my session, and ssh was now dead too. And that was it. Game over for the weekend, Id have to wait until I got back home.
## NixOS to the Rescue
End of the weekend, I get back home, plug a screen into the server, and hook up a USB keyboard. And heres where NixOS really shows its magic.
- I reboot into an earlier generation with no issues.
- I remove rtorrent.nix and another imported file.
- I rebuild and reboot.
- Once it comes back up, services are running again. All thats left is a bit of cleanup in the Git repo.
## Lessons Learned
This whole thing could be a chapter of “self-hosting the hard way.” You always learn best the hard way, dont you? So, to sum up:
- Dont mess with configs on weekends—and absolutely not the networking part.
- Keep Git up to date so you can roll back easily; it makes git reset a lot simpler.
- NixOS is insanely useful when it comes to fixing your screw-ups in no time flat.
## Resolutions
Beyond the obvious—stop making critical changes when I dont have physical access to the machine—I think Ill set up a method to build NixOS VMs directly from my flake directories, just to test out some configurations. At the very least, Ill create separate branches for experiments, so I can always rebuild from master if needed. Way simpler in the long run.
In short, NixOS gives you huge flexibility. Might as well take full advantage of it, right?