mirror of
https://github.com/gburd/nix-config.git
synced 2024-09-09 11:26:12 +00:00
32 lines
623 B
Nix
32 lines
623 B
Nix
|
{ lib, hostname, ... }:
|
||
|
let
|
||
|
# Firewall configuration variable for syncthing
|
||
|
syncthing = {
|
||
|
hosts = [
|
||
|
"designare"
|
||
|
"micropc"
|
||
|
"p1"
|
||
|
"p2-max"
|
||
|
"ripper"
|
||
|
"trooper"
|
||
|
"vm"
|
||
|
"win2"
|
||
|
"win-max"
|
||
|
"zed"
|
||
|
];
|
||
|
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;
|
||
|
};
|
||
|
};
|
||
|
}
|