mirror of
https://github.com/ilyakooo0/nixpkgs.git
synced 2024-12-26 04:43:09 +03:00
Add optional IPv6 support for nix-binary-cache
This commit is contained in:
parent
4e7eb5c538
commit
d64160ec99
@ -39,6 +39,10 @@ parse_opts () {
|
||||
echo "PORT=$1"
|
||||
shift;
|
||||
;;
|
||||
--ipv6)
|
||||
shift;
|
||||
echo "USE_IPV6=enable"
|
||||
;;
|
||||
--help)
|
||||
cat <<EOF >&2
|
||||
"$0": start the Nix binary cache serving the Nix store dynamically.
|
||||
@ -57,6 +61,8 @@ Recognized options:
|
||||
--nix-remote 'daemon' or empty string '' - whether to use daemon for store
|
||||
operations
|
||||
|
||||
--ipv6 enable ipv6
|
||||
|
||||
--help show help and exit
|
||||
EOF
|
||||
exit 1;
|
||||
@ -82,6 +88,12 @@ cgi.assign = ( \".cgi\" => \"@shell@\" )
|
||||
setenv.add-request-header = ( \"NIX_BINARY_CACHE_CONFIG\" => \"$workingdir/nix-binary-cache.conf\" )
|
||||
" > lighttpd.conf
|
||||
|
||||
test -n "$USE_IPV6" && echo "
|
||||
\$SERVER[\"socket\"] == \"[::]:$PORT\" {
|
||||
server.use-ipv6 = \"enable\"
|
||||
}
|
||||
" >> lighttpd.conf
|
||||
|
||||
cp @out@/nix-binary-cache.cgi .
|
||||
cp @out@/nix-binary-cache.cgi ./nix-bc.cgi
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user