Created
June 29, 2018 23:20
-
-
Save emmanuelrosa/7e7cdb5da97b51659707235afd551710 to your computer and use it in GitHub Desktop.
Hosts to block in /etc/hosts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ stdenv, pkgs, lib }: | |
let | |
rawHosts = builtins.fetchurl http://winhelp2002.mvps.org/hosts.txt; | |
cleanedHosts = stdenv.mkDerivation { | |
name = "mvps-hosts"; | |
phases = [ "installPhase" ]; | |
installPhase = '' | |
cat ${rawHosts} | tr -s '\r' '\n' | sed -e '/^#/ d' | cut -d ' ' -f 1,2 | sed -e '/localhost/ d' > $out | |
''; | |
}; | |
in | |
lib.readFile cleanedHosts |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment