Last active
September 17, 2017 12:51
-
-
Save fpletz/cb1bfaf976921a28436821e6e5182fd0 to your computer and use it in GitHub Desktop.
cache.nixos.community mirror
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
# Mirrors only the NixOS Binary Cache from cache.nixos.community | |
let | |
cacheHostname = "cache.nixos.ffmuc.net"; | |
cacheFolder = "/srv/nixos-cache"; | |
in { | |
systemd.services."rsync-nixos-cache" = { | |
startAt = "hourly"; | |
serviceConfig = { | |
Type = "oneshot"; | |
ExecStart = "${pkgs.rsync}/bin/rsync -rtlvH --delete-after --delay-updates --safe-links rsync://rsync.nixos.community/nixos/binary_cache/ ${cacheFolder}/binary_cache"; | |
}; | |
}; | |
services.rsyncd = { | |
enable = true; | |
motd = "Welcome at ${cacheHostname}."; | |
modules = { | |
nixos = { path = cacheFolder; | |
"read only" = "yes"; | |
"filter" = "- ***/.~tmp~"; | |
comment = "NixOS releases"; | |
}; | |
}; | |
}; | |
services.nginx = { | |
enable = true; | |
recommendedOptimisation = true; | |
recommendedTlsSettings = true; | |
recommendedGzipSettings = true; | |
recommendedProxySettings = true; | |
virtualHosts = { | |
"${cacheHostname}" = { | |
addSSL = true; | |
enableACME = true; | |
root = "/tank/nixos-cache/binary_cache"; | |
}; | |
}; | |
}; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment