mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-07-12 05:16:25 +03:00
firewalld: init at 0.4.4.4
Includes systemd module.
This commit is contained in:
parent
fde0bad577
commit
178a96f99b
4 changed files with 150 additions and 0 deletions
53
nixos/modules/services/networking/firewalld.nix
Normal file
53
nixos/modules/services/networking/firewalld.nix
Normal file
|
@ -0,0 +1,53 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
cfg = config.networking.firewalld;
|
||||
|
||||
in {
|
||||
###### interface
|
||||
|
||||
options = {
|
||||
networking.firewalld = {
|
||||
enable = mkOption {
|
||||
type = types.bool;
|
||||
default = false;
|
||||
description =
|
||||
''
|
||||
Whether to enable firewalld. firewalld is a high-level Linux-based packet
|
||||
filtering framework intended for desktop use cases.
|
||||
|
||||
This conflicts with the standard networking firewall, so make sure to
|
||||
disable it before using firewalld.
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
###### implementation
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
assertions = [{
|
||||
assertion = config.networking.firewall.enable == false;
|
||||
message = "You can not use firewalld with services.networking.firewall.";
|
||||
}];
|
||||
|
||||
environment.etc = [
|
||||
{ source = "${pkgs.firewalld}/etc/firewalld";
|
||||
target = "firewalld"; }
|
||||
];
|
||||
|
||||
services = {
|
||||
dbus.packages = with pkgs; [ firewalld ];
|
||||
};
|
||||
|
||||
systemd = {
|
||||
packages = with pkgs; [ firewalld ];
|
||||
|
||||
services.firewalld = {
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue