zion/modules/networking.nix

50 lines
806 B
Nix
Raw Normal View History

2019-11-06 23:04:16 +01:00
{ config, pkgs, lib, ... }:
let password = builtins.readFile /var/lib/ddclient/token;
in
2019-11-06 23:04:16 +01:00
{
2020-01-29 00:20:52 +01:00
environment.systemPackages = with pkgs; [
wireguard
wireguard-tools
];
2020-01-28 21:57:53 +01:00
# Enable zeroconf
services.avahi = {
enable = true;
nssmdns = true;
publish = {
enable = true;
userServices = true;
};
};
2019-11-06 23:04:16 +01:00
# Dynamic DNS configuration
services.ddclient = {
enable = true;
quiet = true;
2019-11-10 17:47:46 +01:00
protocol = "duckdns";
domains = [ "coolneng.duckdns.org" ];
inherit password;
2019-11-06 23:04:16 +01:00
};
# Firewall configuration
networking.firewall = {
allowedTCPPorts = [
631 # Cups
6566 # SANE
80
443
];
2019-11-06 23:04:16 +01:00
autoLoadConntrackHelpers = true;
connectionTrackingModules = [ "sane" ];
};
2019-11-11 14:30:45 +01:00
2019-12-09 10:04:41 +01:00
# Disable IPv6
networking.enableIPv6 = false;
2019-11-06 23:04:16 +01:00
}