this post was submitted on 12 Jul 2026
78 points (96.4% liked)

Linux

18429 readers
21 users here now

Welcome to c/linux!

Welcome to our thriving Linux community! Whether you're a seasoned Linux enthusiast or just starting your journey, we're excited to have you here. Explore, learn, and collaborate with like-minded individuals who share a passion for open-source software and the endless possibilities it offers. Together, let's dive into the world of Linux and embrace the power of freedom, customization, and innovation. Enjoy your stay and feel free to join the vibrant discussions that await you!

Rules:

  1. Stay on topic: Posts and discussions should be related to Linux, open source software, and related technologies.

  2. Be respectful: Treat fellow community members with respect and courtesy.

  3. Quality over quantity: Share informative and thought-provoking content.

  4. No spam or self-promotion: Avoid excessive self-promotion or spamming.

  5. No NSFW adult content

  6. Follow general lemmy guidelines.

founded 3 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
[–] ImgurRefugee114@reddthat.com 8 points 2 weeks ago* (last edited 2 weeks ago) (1 children)

networking.firewall.enable = true;

Tap for spoilerYeah I'm familiar with all the tools but - omg - have NixOS modules ever changed my life

[–] esc@piefed.social 3 points 2 weeks ago (1 children)
[–] Gregers@lemmy.world 6 points 2 weeks ago (1 children)
[–] esc@piefed.social 3 points 2 weeks ago (1 children)

For me it's clearly not obvious what exactly 'enabling firewall' entails, what policy is applied, what rules, etc., etc.

[–] ImgurRefugee114@reddthat.com 3 points 2 weeks ago* (last edited 2 weeks ago) (1 children)

There are sensible defaults but it ultimately depends on what the module is doing and how you configure it.

https://github.com/NixOS/nixpkgs/blob/8c91a71d13451abc40eb9dae8910f972f979852f/nixos/modules/services/networking/firewall.nix

The beauty is that this, or your own custom modules, become a declarative and reproducible abstraction layer which (if properly written) lets you focus on the what rather than the how.

... You could also write a bunch of scripts, which is what I used to do before I joined the cult.

[–] esc@piefed.social 3 points 2 weeks ago

Nftables rulesets are reproducible and let you focus on what rather than how. I've tried nix some time ago, conceptually cool distro, but it requires a lot of time, time that can be used configuring emacs 😝.