about summary refs log tree commit diff
path: root/modules
diff options
context:
space:
mode:
Diffstat (limited to 'modules')
-rw-r--r--modules/internet.nix20
1 files changed, 15 insertions, 5 deletions
diff --git a/modules/internet.nix b/modules/internet.nix
index bb0e554..c24b112 100644
--- a/modules/internet.nix
+++ b/modules/internet.nix
@@ -1,5 +1,12 @@
 ## Basic rules for interacting with the internet
 { pkgs, lib, ... }:
+let
+  blocklist = pkgs.writeText "hosts" ''
+    0.0.0.0 netflix.com
+    0.0.0.0 hbogo.com
+    0.0.0.0 www.facebook.com
+  '';
+in
 {
   # networking.nameservers = lib.mkForce [
   #   "192.168.1.136"
@@ -15,9 +22,12 @@
   '';
 
 
-  networking.extraHosts = pkgs.stdenv.lib.readFile ( pkgs.fetchurl {
-    url = "https://raw.githubusercontent.com/StevenBlack/hosts/d2be343994aacdec74865ff8d159cf6e46359adf/alternates/fakenews-gambling-porn/hosts";
-    sha256 = "1la5rd0znc25q8yd1iwbx22zzqi6941vyzmgar32jx568j856s8j";
-  } );
+  networking.hostFiles = [
+    ( pkgs.fetchurl {
+      url = "https://raw.githubusercontent.com/StevenBlack/hosts/d2be343994aacdec74865ff8d159cf6e46359adf/alternates/fakenews-gambling-porn/hosts";
+      sha256 = "1la5rd0znc25q8yd1iwbx22zzqi6941vyzmgar32jx568j856s8j";
+    } )
+      blocklist
+    ];
 
-}
+  }