Skip to content

Instantly share code, notes, and snippets.

@notgne2
Created December 28, 2019 15:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save notgne2/d8395f4612852b1f3344c4765a8d4d2b to your computer and use it in GitHub Desktop.
Save notgne2/d8395f4612852b1f3344c4765a8d4d2b to your computer and use it in GitHub Desktop.
systemd.services.hostsblock = {
wantedBy = [ "default.target" ];
serviceConfig = {
Type = "simple";
ExecStart = "${pkgs.curl}/bin/curl https://raw.githubusercontent.com/StevenBlack/hosts/master/hosts -o /var/lib/hostsblock";
};
};
systemd.timers.hostsblock = {
timerConfig = {
Unit = "hostsblock.service";
OnCalendar = "daily";
};
wantedBy = [ "default.target" ];
};
networking.extraHosts = builtins.readFile /var/lib/hostsblock;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment