summaryrefslogtreecommitdiff
path: root/archetypes/profiles/router
diff options
context:
space:
mode:
Diffstat (limited to 'archetypes/profiles/router')
-rw-r--r--archetypes/profiles/router/default.nix37
1 files changed, 37 insertions, 0 deletions
diff --git a/archetypes/profiles/router/default.nix b/archetypes/profiles/router/default.nix
new file mode 100644
index 0000000..58e3407
--- /dev/null
+++ b/archetypes/profiles/router/default.nix
@@ -0,0 +1,37 @@
+{ lib, pkgs, ... }: let
+ mkRouter = lib.mkOverride 800;
+
+ # https://wiki.nixos.org/wiki/Networking
+ nixosConfig = {
+ services.unbound = {
+ _blocklists = {
+ enable = true;
+ 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;
+ routing = {
+ enable = mkRouter true;
+ interfaces = {
+ lan = mkRouter "lan0";
+ wan = mkRouter "wan0";
+ };
+ };
+ };
+ };
+
+ homeConfig = {};
+in {
+ imports = [ (lib._mkProfileArchetype "router" nixosConfig homeConfig) ];
+}
+