mirror of
https://github.com/gburd/nix-config.git
synced 2024-11-15 08:46:25 +00:00
22 lines
494 B
Nix
22 lines
494 B
Nix
{ lib, hostname, ... }:
|
|
let
|
|
# Firewall configuration variable for syncthing
|
|
syncthing = {
|
|
hosts = [
|
|
"floki"
|
|
];
|
|
tcpPorts = [ 22000 ];
|
|
udpPorts = [ 22000 21027 ];
|
|
};
|
|
in
|
|
{
|
|
networking = {
|
|
firewall = {
|
|
enable = true;
|
|
allowedTCPPorts = [ ]
|
|
++ lib.optionals (builtins.elem hostname syncthing.hosts) syncthing.tcpPorts;
|
|
allowedUDPPorts = [ ]
|
|
++ lib.optionals (builtins.elem hostname syncthing.hosts) syncthing.udpPorts;
|
|
};
|
|
};
|
|
}
|