Compare commits
No commits in common. "4af46920cc648d381f4b9366330122585cead026" and "82b292946a6a142fe288342906e9d8059ac4a065" have entirely different histories.
4af46920cc
...
82b292946a
@ -12,6 +12,5 @@
|
||||
- Web services and reverse proxy: webstack.nix
|
||||
- Development tools: devops.nix
|
||||
- Smartd: monitoring.nix
|
||||
- Systemd services and timers: periodic.nix
|
||||
|
||||
All the modules are imported in *configuration.nix*
|
||||
|
@ -107,7 +107,6 @@
|
||||
./modules/webstack.nix
|
||||
./modules/devops.nix
|
||||
./modules/monitoring.nix
|
||||
./modules/periodic.nix
|
||||
];
|
||||
|
||||
}
|
||||
|
@ -33,13 +33,11 @@ in {
|
||||
allowedTCPPorts = [
|
||||
631 # Cups
|
||||
6566 # SANE
|
||||
80 # HTTP
|
||||
443 # HTTPS
|
||||
53 # DNS
|
||||
80
|
||||
443
|
||||
];
|
||||
allowedUDPPorts = [
|
||||
1194 # Wireguard
|
||||
53 # DNS
|
||||
];
|
||||
autoLoadConntrackHelpers = true;
|
||||
connectionTrackingModules = [ "sane" ];
|
||||
@ -79,26 +77,5 @@ in {
|
||||
};
|
||||
};
|
||||
|
||||
# DNS server with ad-block
|
||||
services.dnsmasq = {
|
||||
enable = true;
|
||||
servers = [ "176.9.37.132" "116.203.147.31" ];
|
||||
extraConfig = ''
|
||||
domain-needed
|
||||
bogus-priv
|
||||
no-resolv
|
||||
|
||||
listen-address=127.0.0.1,192.168.1.2,10.8.0.1
|
||||
bind-interfaces
|
||||
|
||||
cache-size=10000
|
||||
local-ttl=300
|
||||
|
||||
conf-file=/var/lib/dnsmasq/dnsmasq.blacklist.txt
|
||||
|
||||
address=/coolneng.duckdns.org/192.168.1.2
|
||||
'';
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
|
@ -1,30 +0,0 @@
|
||||
{ config, lib, pkgs, ... }:
|
||||
|
||||
let
|
||||
stateDir = "/var/lib/dnsmasq";
|
||||
blocklist = "${stateDir}/dnsmasq.blacklist.txt";
|
||||
|
||||
in {
|
||||
# Fetch hosts-blocklists daily
|
||||
systemd.services.download-dns-blocklist = {
|
||||
description = "Download hosts-blocklists";
|
||||
wantedBy = [ "default.target" ];
|
||||
path = with pkgs; [ curl ];
|
||||
script =
|
||||
"curl -L https://github.com/notracking/hosts-blocklists/raw/master/dnsmasq/dnsmasq.blacklist.txt -o ${blocklist}";
|
||||
serviceConfig = { Type = "oneshot"; };
|
||||
postStop = ''
|
||||
chown -R dnsmasq ${stateDir}
|
||||
systemctl restart dnsmasq
|
||||
'';
|
||||
};
|
||||
|
||||
systemd.timers.download-dns-blocklist = {
|
||||
description = "Daily download of hosts-blocklists";
|
||||
wantedBy = [ "default.target" ];
|
||||
timerConfig = {
|
||||
OnCalendar = "02:00:00";
|
||||
Unit = "download-dns-blocklist.service";
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Reference in New Issue
Block a user