uboot: (firmwareOdroidC2/C4) don't invoke patch tool, use patches = [] instead
https://github.com/NixOS/nixpkgs/blob/master/pkgs/stdenv/generic/setup.sh#L948 this can do it nicely. Signed-off-by: Anton Arapov <anton@deadbeef.mx>
This commit is contained in:
commit
56de2bcd43
30691 changed files with 3076956 additions and 0 deletions
117
pkgs/servers/http/nix-binary-cache/nix-binary-cache-start.in
Normal file
117
pkgs/servers/http/nix-binary-cache/nix-binary-cache-start.in
Normal file
|
|
@ -0,0 +1,117 @@
|
|||
#! @shell@
|
||||
|
||||
parse_opts () {
|
||||
while @coreutils@/test -n "$1" && @coreutils@/test "x$1" != x-- ; do
|
||||
case "$1" in
|
||||
--store-dir)
|
||||
shift;
|
||||
echo "STORE_DIR='$1'"
|
||||
shift;
|
||||
;;
|
||||
--priority)
|
||||
shift;
|
||||
echo "PRIORITY=$1";
|
||||
shift;
|
||||
;;
|
||||
--compression)
|
||||
shift;
|
||||
echo "COMPRESSION=$1";
|
||||
shift;
|
||||
;;
|
||||
--key)
|
||||
shift;
|
||||
echo "KEY=${1#*:}"
|
||||
echo "KEYNAME=${1%%:*}"
|
||||
shift;
|
||||
;;
|
||||
--nix-remote)
|
||||
shift;
|
||||
echo "NIX_REMOTE=$1"
|
||||
shift;
|
||||
;;
|
||||
--mass-query)
|
||||
shift;
|
||||
echo "MASS_QUERY=$1"
|
||||
shift;
|
||||
;;
|
||||
--port)
|
||||
shift;
|
||||
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.
|
||||
|
||||
Recognized options:
|
||||
|
||||
--port server port
|
||||
--store-dir served Nix store
|
||||
|
||||
--priority binary cache priority
|
||||
--mass-query 0 or 1 - whether binary cache expects queries for nix-env -qas
|
||||
|
||||
--compression compression to use: bzip2 or xz
|
||||
--key name:/path/to/key - key to use for narinfo signing
|
||||
|
||||
--nix-remote 'daemon' or empty string '' - whether to use daemon for store
|
||||
operations
|
||||
|
||||
--ipv6 enable ipv6
|
||||
|
||||
--help show help and exit
|
||||
EOF
|
||||
exit 1;
|
||||
;;
|
||||
*) shift ;;
|
||||
esac;
|
||||
done
|
||||
}
|
||||
|
||||
workingdir="$(@coreutils@/mktemp -d)"
|
||||
cd "$workingdir"
|
||||
|
||||
PORT=8080
|
||||
(echo "STORE_DIR=${NIX_STORE_DIR:-/nix/store}"; parse_opts "$@"
|
||||
) > nix-binary-cache.conf || exit
|
||||
. "$workingdir/nix-binary-cache.conf"
|
||||
|
||||
echo "
|
||||
server.port = $PORT
|
||||
server.modules = ( \"mod_cgi\", \"mod_setenv\", )
|
||||
server.document-root = \"$workingdir\"
|
||||
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
|
||||
|
||||
ip="$(@iproute@/ip a | @gnugrep@/grep 'inet .* scope global' | @coreutils@/head -n 1)"
|
||||
ip="${ip%%/*}"
|
||||
ip="${ip##* }"
|
||||
|
||||
url="http://$ip:$PORT/nix-bc.cgi?"
|
||||
|
||||
echo "Working directory: $workingdir"
|
||||
echo
|
||||
echo "Address of the binary cache: $url"
|
||||
echo
|
||||
echo "Usage example: NIX_REMOTE= nix-store --option binary-caches '$url'"
|
||||
echo
|
||||
echo
|
||||
|
||||
@lighttpd@/lighttpd -D -f "$workingdir/lighttpd.conf"
|
||||
|
||||
cd /
|
||||
@coreutils@/rm -rf "$workingdir"
|
||||
Loading…
Add table
Add a link
Reference in a new issue