# Firewalld-nix: FirewallD for NixOS

**URL:** https://discourse.nixos.org/t/firewalld-nix-firewalld-for-nixos/60474
**Category:** Announcements
**Created:** [February 18, 2025, 6:54am UTC](https://discourse.nixos.org/t/firewalld-nix-firewalld-for-nixos/60474 "2025-02-18T06:54:51Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Prince213](https://discourse.nixos.org/user_avatar/discourse.nixos.org/prince213/32/30633_2.png) [@Prince213](https://discourse.nixos.org/u/Prince213)
#### Post date: [February 18, 2025, 6:54am UTC](https://discourse.nixos.org/t/firewalld-nix-firewalld-for-nixos/60474/1 "2025-02-18T06:54:51Z")

</div>

Hello everyone,

I would like to introduce firewalld-nix that I’ve been working for the past few days, which contains:

- a working firewalld derivation with working GUI applet
- a NixOS module for declarative configurations

It’s not complete and has rough edges, but it should work for simple use cases now.

[https://git.sr.ht/~prince213/firewalld-nix](https://git.sr.ht/~prince213/firewalld-nix)

As a side note, firewalld related issues is currently being tracked in

> <https://github.com/NixOS/nixpkgs/issues/165882>
>
> \*\*Project description\*\*
> I'm really just wondering if there's any possibility Ni…xOS will adopt firewalld as a native firewall option?
> 
> It seems odd that we have similar options like Shorewall packaged up but not firewalld.
> 
> I see there was an effort to package this previously which was then reverted but haven't seen any lively discussion on the topic so thought I'd kick things off.
> 
> \*\*Metadata\*\*
> 
> \* homepage URL: https://firewalld.org/
> \* source URL: https://github.com/firewalld/firewalld
> \* license: gpl2
> \* platforms: linux

---

<div class="post-metadata">

### Author: ![adamcstephens](https://discourse.nixos.org/user_avatar/discourse.nixos.org/adamcstephens/32/35883_2.png) [@adamcstephens](https://discourse.nixos.org/u/adamcstephens)
#### Post date: [February 18, 2025, 1:25pm UTC](https://discourse.nixos.org/t/firewalld-nix-firewalld-for-nixos/60474/2 "2025-02-18T13:25:31Z")

</div>

Nice work! Could you add some more to the example in the readme showing more of the use of the rules/zones/etc?

---

<div class="post-metadata">

### Author: ![Prince213](https://discourse.nixos.org/user_avatar/discourse.nixos.org/prince213/32/30633_2.png) [@Prince213](https://discourse.nixos.org/u/Prince213)
#### Post date: [February 18, 2025, 2:31pm UTC](https://discourse.nixos.org/t/firewalld-nix-firewalld-for-nixos/60474/3 "2025-02-18T14:31:01Z")

</div>

Hi @adamcstephens, I’ve just added an example configuration `example.nix`.

[https://git.sr.ht/~prince213/firewalld-nix/tree/main/item/example.nix](https://git.sr.ht/~prince213/firewalld-nix/tree/main/item/example.nix)

---

<div class="post-metadata">

### Author: ![Prince213](https://discourse.nixos.org/user_avatar/discourse.nixos.org/prince213/32/30633_2.png) [@Prince213](https://discourse.nixos.org/u/Prince213)
#### Post date: [February 23, 2025, 1:34pm UTC](https://discourse.nixos.org/t/firewalld-nix-firewalld-for-nixos/60474/4 "2025-02-23T13:34:49Z")

</div>

Zones shipped with FirewallD such as `drop` or `block` have been converted to Nix.  
This means that you can modify the default configurations of zones rather than always overriding them.
