about summary refs log tree commit diff
path: root/modules
diff options
context:
space:
mode:
authorPatryk Niedźwiedziński <pniedzwiedzinski19@gmail.com>2021-04-20 09:26:23 +0200
committerPatryk Niedźwiedziński <pniedzwiedzinski19@gmail.com>2021-04-20 09:26:23 +0200
commit49487eefca4e92e4d83e2cae2d91e8d5517a9e0c (patch)
tree49fb490c0d42ee9f80cb87074abec416cfa39e01 /modules
parent167733884d9e80b56ce168d45c08404bc4aabe5b (diff)
downloaddots-49487eefca4e92e4d83e2cae2d91e8d5517a9e0c.tar.gz
dots-49487eefca4e92e4d83e2cae2d91e8d5517a9e0c.zip
Updates
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
+    ];
 
-}
+  }