blob: cbe7e3ebd9710a5f1370b75a68f92cc3aac65d7c (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
|
{ stdenv, ffmpeg-full, tone, pname, nodejs }: ''
#!${stdenv.shell}
port=8000
host=0.0.0.0
config=$(pwd)/config
metadata=$(pwd)/metadata
LONGOPTS=host:,port:,config:,metadata:,help
args=$(getopt -l "$LONGOPTS" -o h -- "$@")
eval set -- "$args"
while [ $# -ge 1 ]; do
case "$1" in
--)
# No more options left.
shift
break
;;
--host)
host="$2"
shift
;;
--port)
port="$2"
shift
;;
--config)
if [[ "''${2:0:1}" = "/" ]]; then
config="$2"
else
config="$(pwd)/$2"
fi
shift
;;
--metadata)
if [[ "''${2:0:1}" = "/" ]]; then
metadata="$2"
else
metadata="$(pwd)/$2"
fi
shift
;;
--help|-h)
echo "Usage: audiobookshelf [--host <host>] [--port <port>] [--metadata <dir>] [--config <dir>]"
shift
;;
esac
shift
done
NODE_ENV=production \
SOURCE=nixpkgs \
FFMPEG_PATH=${ffmpeg-full}/bin/ffmpeg \
FFPROBE_PATH=${ffmpeg-full}/bin/ffprobe \
TONE_PATH=${tone}/bin/tone \
CONFIG_PATH="$config" \
METADATA_PATH="$metadata" \
PORT="$port" \
HOST="$host" \''
|