nixos/applications/pelican/pelican-panel-install.nix

31 lines
755 B
Nix
Raw Permalink Normal View History

2024-12-09 23:08:39 +00:00
{
pkgs,
dir,
}:
pkgs.writeShellScriptBin "pelican-install" ''
DIR=${dir}
echo "Installing Pelican panel to $DIR ..."
if [ -d $DIR ]; then
echo "Directory $DIR already exists, exiting"
exit 1
fi
echo "Creating directory ..."
mkdir -p $DIR
cd $DIR
echo "Downloading Pelican panel ..."
curl -L https://github.com/pelican-dev/panel/releases/latest/download/panel.tar.gz | tar -xzv
echo "Installing Pelican panel using composer ..."
yes | composer install --no-dev --optimize-autoloader
echo "Setting up the environment ..."
yes "" | php artisan p:environment:setup
echo "Setting permissions ..."
chmod -R 755 storage/* bootstrap/cache/
2024-12-09 23:08:39 +00:00
chown -R nginx:acme $DIR
echo "Pelican panel installed successfully"
2024-12-09 23:08:39 +00:00
''