The responses don’t have to be strictly NixOS or Linux specific as I expect the general process to be very similar.
I never hardened a system before so I’m not sure what things I should be focusing on and what solutions are out there. I’m hearing a lot good on SELinux and apparmour but but those sadly aren’t supported on NixOS. Recently I set up adguard home with somewhat strict blocklists and SearxNG to take control over my web searches. In the coming days I intend to set up wireguard and a VPN in my config and I also have some firefox extensions for blocking ads, trackers, JS, port scanning, etc. but it all feels surface level and I don’t know where to take things from there. What are you guys doing with your setups?
Usually I prefer to never ask questions and look things up myself but reddit will soon block everything with a login wall and that’s where I get most info from so I’m finally giving it a shot. :p


Impermanence
Edit: sorry I didn’t link. It has been an incredible overnight upgrade to security for me. I have all of my stateful directories LUKS encrypted and copying on write to a btrfs subvolume that gets cloned over at boot to each time and as a result, I have a minuscule attack surface. On top of that, all of the machines on my network are fully impermanent and write their state to a local NAS. It’s pretty elegant. I highly recommend rehearsing the switch to impermanent via a QEMU VM and not fully making the switch until your data is backed up.
I did a rehearsal on my home directory that took a few iterations to catch all of the files I needed to declare. A diff on the two btrfs directories each reboot made that fairly easy. I wish I could share the config but it would dox the shit out of me!
Mind expending on that a bit, even if just a link to more info?
https://github.com/nix-community/impermanence
Your root directory is mounted as a tmpfs which means it gets cleared every startup. The only way to persist config or data is to have it in your Nix config or use impermanence to bind mount a folder to a persisted directly.
I use it on my servers. I have Impermanence + LUKS with remote unlocking on my servers
deleted by creator
Appreciate the update!