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

39 lines
2.4 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

+++
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?