diff options
| author | Tim Keller <tjk@tjkeller.xyz> | 2026-01-01 20:38:18 -0600 |
|---|---|---|
| committer | Tim Keller <tjk@tjkeller.xyz> | 2026-01-01 20:38:18 -0600 |
| commit | 8cead66675a61b30a88b02d4c3bd5bfbf2d0afc3 (patch) | |
| tree | 7644517452399ff385868fe0001518410e1c1154 /archetypes/profiles/router | |
| parent | 91eac5b51bb6b9fa5853753310a3de337d192568 (diff) | |
| download | nixos-8cead66675a61b30a88b02d4c3bd5bfbf2d0afc3.tar.xz nixos-8cead66675a61b30a88b02d4c3bd5bfbf2d0afc3.zip | |
nftables routing module for router
Diffstat (limited to 'archetypes/profiles/router')
| -rw-r--r-- | archetypes/profiles/router/default.nix | 30 |
1 files changed, 18 insertions, 12 deletions
diff --git a/archetypes/profiles/router/default.nix b/archetypes/profiles/router/default.nix index 646982b..58e3407 100644 --- a/archetypes/profiles/router/default.nix +++ b/archetypes/profiles/router/default.nix @@ -1,26 +1,32 @@ { lib, pkgs, ... }: let mkRouter = lib.mkOverride 800; + # https://wiki.nixos.org/wiki/Networking nixosConfig = { services.unbound = { _blocklists = { enable = true; - blocklists = { - hageziNSFW = [ - "https://cdn.jsdelivr.net/gh/hagezi/dns-blocklists@latest/rpz/nsfw.txt" - "https://gitlab.com/hagezi/mirror/-/raw/main/dns-blocklists/rpz/nsfw.txt" - "https://codeberg.org/hagezi/mirror2/raw/branch/main/dns-blocklists/rpz/nsfw.txt" - ]; - hageziPro = [ - "https://cdn.jsdelivr.net/gh/hagezi/dns-blocklists@latest/rpz/pro.txt" - "https://gitlab.com/hagezi/mirror/-/raw/main/dns-blocklists/rpz/pro.txt" - "https://codeberg.org/hagezi/mirror2/raw/branch/main/dns-blocklists/rpz/pro.txt" + blocklists = let + hageziList = list: [ + "https://cdn.jsdelivr.net/gh/hagezi/dns-blocklists@latest/rpz/${list}.txt" + "https://gitlab.com/hagezi/mirror/-/raw/main/dns-blocklists/rpz/${list}.txt" + "https://codeberg.org/hagezi/mirror2/raw/branch/main/dns-blocklists/rpz/${list}.txt" ]; + in { + hageziNSFW = hageziList "nsfw"; + hageziPro = hageziList "pro"; }; }; }; - services._router.dnsDhcpConfig = { - enable = mkRouter true; + services._router = { + dnsDhcpConfig.enable = mkRouter true; + routing = { + enable = mkRouter true; + interfaces = { + lan = mkRouter "lan0"; + wan = mkRouter "wan0"; + }; + }; }; }; |
