git.iko.soy/typeable/nixpkgs
on master help sign in
Add optional IPv6 support for nix-binary-cache
commitd64160ec996d922234462f88a72b043a7b19ec85 authorMichael Raskin <7c6f434c@mail.ru> dateSat 3 Jan 2015, 03:03 (12 years ago) parent4e7eb5c
1 file changed+12
pkgs/servers/http/nix-binary-cache/nix-binary-cache-start.in+12
pkgs/servers/http/nix-binary-cache/nix-binary-cache-start.in+12
@@ -39,6 +39,10 @@ parse_opts () {
3939 echo "PORT=$1"
4040 shift;
4141 ;;
42+ --ipv6)
43+ shift;
44+ echo "USE_IPV6=enable"
45+ ;;
4246 --help)
4347 cat <<EOF >&2
4448"$0": start the Nix binary cache serving the Nix store dynamically.
@@ -57,6 +61,8 @@ Recognized options:
5761--nix-remote 'daemon' or empty string '' - whether to use daemon for store
5862 operations
5963
64+--ipv6 enable ipv6
65+
6066--help show help and exit
6167EOF
6268 exit 1;
@@ -82,6 +88,12 @@ cgi.assign = ( \".cgi\" => \"@shell@\" )
8288setenv.add-request-header = ( \"NIX_BINARY_CACHE_CONFIG\" => \"$workingdir/nix-binary-cache.conf\" )
8389" > lighttpd.conf
8490
91+test -n "$USE_IPV6" && echo "
92+\$SERVER[\"socket\"] == \"[::]:$PORT\" {
93+server.use-ipv6 = \"enable\"
94+}
95+" >> lighttpd.conf
96+
8597cp @out@/nix-binary-cache.cgi .
8698cp @out@/nix-binary-cache.cgi ./nix-bc.cgi
8799