stockholm/krebs/2configs/cache.nsupdate.info.nix

38 lines
1.1 KiB
Nix
Raw Normal View History

2018-12-03 08:20:14 +00:00
{ pkgs, lib, ... }:
2018-11-20 23:03:49 +00:00
with lib;
let
domain = "cache.nsupdate.info";
in {
# This only works for a single domain for nsupdate.info as multiple usernames
# and passwords are required for multiple domains
services.ddclient = {
enable = true;
server = "ipv4.nsupdate.info";
username = domain;
password = import "${config.krebs.secret.directory}/nsupdate-cache.nix";
2018-11-20 23:03:49 +00:00
domains = [ domain ];
use= "if, if=et0";
# use = "web, web=http://ipv4.nsupdate.info/myip";
};
krebs.cachecache = {
enable = true;
2018-12-03 08:20:14 +00:00
enableSSL = true; # disable letsencrypt for testing
2018-11-20 23:03:49 +00:00
cacheDir = "/var/cache/nix-cache-cache";
maxSize = "10g";
2018-12-03 08:20:14 +00:00
indexFile = pkgs.fetchurl {
url = "https://raw.githubusercontent.com/krebs/35c3-nixos-cache/master/index.html";
2018-12-03 21:06:23 +00:00
sha256 = "1vlngzbn0jipigspccgikd7xgixksimdl4wf8ix7d30ljx47p9n0";
2018-12-03 08:20:14 +00:00
};
2018-11-20 23:03:49 +00:00
# assumes that the domain is reachable from the internet
virtualHost = domain;
};
boot.kernelModules = [ "tcp_bbr" ];
boot.kernel.sysctl."net.ipv4.tcp_congestion_control" = "bbr";
boot.kernel.sysctl."net.core.default_qdisc" = "fq";
networking.firewall.allowedTCPPorts = [ 80 443 ];
}