You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

44 lines
1.1 KiB

{
pkgs ? import <nixpkgs> {}
}:
with pkgs; mkShell {
shellHook = ''
PEERTUBE=${peertube}
function deploy {
rm -rf /tmp/peertube
mkdir -p /tmp/peertube/{config,storage}
cp -r $PEERTUBE /tmp/peertube/code
mkdir /tmp/psql
initdb -D /tmp/psql/ --no-locale --encoding=UTF8
pg_ctl -D /tmp/psql -l logfile -o "--unix_socket_directories='$PWD'" start
createdb -h $PWD peertube
psql -h $PWD peertube -c "CREATE EXTENSION pg_trgm;"
psql -h $PWD peertube -c "CREATE EXTENSION unaccent;"
cp $PEERTUBE/config/default.yaml /tmp/peertube/config/default.yaml
cp production.yaml /tmp/peertube/config/production.yaml
echo "edit production.yaml"
# redis-server
echo "Launch redis-server in a separate shell"
cd /tmp/peertube/code
export NODE_ENV=production
export NODE_CONFIG_DIR=/tmp/peertube/config
node dist/server.js
# pg_ctl -D /tmp/psql stop
# stop redis
}
'';
nativeBuildInputs = [
peertube
postgresql_14
curl
unzip
nodejs-16_x
yarn
ffmpeg
openssl
redis
gcc
nginx
];
}