lol

Add optional IPv6 support for nix-binary-cache

+12
+12
pkgs/servers/http/nix-binary-cache/nix-binary-cache-start.in
··· 39 39 echo "PORT=$1" 40 40 shift; 41 41 ;; 42 + --ipv6) 43 + shift; 44 + echo "USE_IPV6=enable" 45 + ;; 42 46 --help) 43 47 cat <<EOF >&2 44 48 "$0": start the Nix binary cache serving the Nix store dynamically. ··· 56 60 57 61 --nix-remote 'daemon' or empty string '' - whether to use daemon for store 58 62 operations 63 + 64 + --ipv6 enable ipv6 59 65 60 66 --help show help and exit 61 67 EOF ··· 81 87 cgi.assign = ( \".cgi\" => \"@shell@\" ) 82 88 setenv.add-request-header = ( \"NIX_BINARY_CACHE_CONFIG\" => \"$workingdir/nix-binary-cache.conf\" ) 83 89 " > lighttpd.conf 90 + 91 + test -n "$USE_IPV6" && echo " 92 + \$SERVER[\"socket\"] == \"[::]:$PORT\" { 93 + server.use-ipv6 = \"enable\" 94 + } 95 + " >> lighttpd.conf 84 96 85 97 cp @out@/nix-binary-cache.cgi . 86 98 cp @out@/nix-binary-cache.cgi ./nix-bc.cgi