integration-garage/peertube.nix

45 lines
1.1 KiB
Nix
Raw Normal View History

2021-11-08 15:01:24 +00:00
{
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
];
}