From 49487eefca4e92e4d83e2cae2d91e8d5517a9e0c Mon Sep 17 00:00:00 2001 From: Patryk Niedźwiedziński Date: Tue, 20 Apr 2021 09:26:23 +0200 Subject: Updates --- modules/internet.nix | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) (limited to 'modules/internet.nix') 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 + ]; -} + } -- cgit 1.4.1