Skip to content

nixos/mpd: allow to explicitly close firewall without a warning#484995

Merged
doronbehar merged 1 commit intoNixOS:masterfrom
doronbehar:nixos/mpd@openFirewallWarn
Jan 29, 2026
Merged

nixos/mpd: allow to explicitly close firewall without a warning#484995
doronbehar merged 1 commit intoNixOS:masterfrom
doronbehar:nixos/mpd@openFirewallWarn

Conversation

@doronbehar
Copy link
Contributor

@doronbehar doronbehar commented Jan 29, 2026

Things done

@nixpkgs-ci nixpkgs-ci bot added 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 8.has: module (update) This PR changes an existing module in `nixos/` labels Jan 29, 2026
Copy link
Member

@a-kenji a-kenji left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is still a little odd, for lack of a better term, because this is very different from how most any other service operates in nixpkgs.

That being said, I see this as an improvement and I see no issue with this PR from that standpoint.

@nixpkgs-ci nixpkgs-ci bot added the 12.approvals: 1 This PR was reviewed and approved by one person. label Jan 29, 2026
@doronbehar
Copy link
Contributor Author

That being said, I see this as an improvement and I see no issue with this PR from that standpoint.

Yes I agree. Adding such a warning could be a nice feature to any module that has both openFirewall option and a "bind address" option such as mpd's bind_to_address. I personally don't maintain enough services to push that, but I think it should help users avoid bashing their head when their services are running but are not accessible from outside.

I think this is still a little odd, for lack of a better term, because this is very different from how most any other service operates in nixpkgs.

Thanks for the approval. Could you please test this with your config, I really want to make sure it works for you with those non-trivial network interfaces.

@SigmaSquadron
Copy link
Contributor

Our warnings/assertion infrastructure as a whole could do with a lot of improvement. I think @emilazy was considering something of the sort a while back, but I am not entirely sure what came out of that work.


openFirewall = lib.mkOption {
type = lib.types.bool;
default = false;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It might be more ergonomic if we set the type to be either Boolean or some special string that disabled the warning. null is meaningless, especially since its behaviour is not defined in the option description.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It might be more ergonomic if we set the type to be either Boolean or some special string that disabled the warning. null is meaningless, especially since its behaviour is not defined in the option description.

I agree. Either with null or a specific string the description will have to be modified. If I'll modify the description to explain the meaning of null would you be satisfied?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Whatever is easiest for you seems good to me.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Whatever is easiest for you seems good to me.

Done.

@a-kenji
Copy link
Member

a-kenji commented Jan 29, 2026

Could you please test this with your config, I really want to make sure it works for you with those non-trivial network interfaces.

I tested it with an ipv6 bind_to_address.

@doronbehar
Copy link
Contributor Author

Could you please test this with your config, I really want to make sure it works for you with those non-trivial network interfaces.

I tested it with an ipv6 bind_to_address.

Just out of curiosity, with bind_to_address = "::"?

@doronbehar doronbehar force-pushed the nixos/mpd@openFirewallWarn branch from 5943f40 to d1b74cb Compare January 29, 2026 11:36
@a-kenji
Copy link
Member

a-kenji commented Jan 29, 2026

Yes:

settings.bind_to_address = "[::]";
openFirewall = false;

@doronbehar doronbehar force-pushed the nixos/mpd@openFirewallWarn branch from d1b74cb to 9638294 Compare January 29, 2026 12:20
@doronbehar doronbehar added this pull request to the merge queue Jan 29, 2026
Merged via the queue into NixOS:master with commit 93e8045 Jan 29, 2026
32 of 35 checks passed
@doronbehar doronbehar deleted the nixos/mpd@openFirewallWarn branch January 29, 2026 12:32
hyperparabolic added a commit to hyperparabolic/nix-config that referenced this pull request Feb 10, 2026
NixOS/nixpkgs#484995 got merged, and setting
this false (default is now null) suppresses firewall warnings.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 8.has: module (update) This PR changes an existing module in `nixos/` 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. 12.approvals: 1 This PR was reviewed and approved by one person.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

nixos/mpd: cannot configure VPN based auth without emitting warnings

3 participants