install: optional pm2-logrotate

This commit is contained in:
undefined committed 2024-08-04 10:53:24 +08:00
1 parent bb10ecf8f1
commit f7e31ff624
1 file changed
+3 -3
+3 -3
View File
@@ -322,7 +322,7 @@ ${nixConfBase}`);
exec('nix-channel --add https://nixos.org/channels/nixpkgs-unstable nixpkgs', { stdio: 'inherit' }); exec('nix-channel --add https://nixos.org/channels/nixpkgs-unstable nixpkgs', { stdio: 'inherit' });
exec('nix-channel --update', { stdio: 'inherit' }); exec('nix-channel --update', { stdio: 'inherit' });
}, },
'nix-env -iA nixpkgs.pm2 nixpkgs.yarn nixpkgs.esbuild nixpkgs.bash nixpkgs.unzip nixpkgs.zip nixpkgs.diffutils nixpkgs.patch', `nix-env -iA ${['pm2', 'yarn', 'esbuild', 'bash', 'unzip', 'zip', 'diffutils', 'patch', 'screen'].map((i) => `nixpkgs.${i}`).join(' ')}`,
'yarn config set disable-self-update-check true', 'yarn config set disable-self-update-check true',
async () => { async () => {
const rl = createInterface(process.stdin, process.stdout); const rl = createInterface(process.stdin, process.stdout);
@@ -573,8 +573,8 @@ ${nixConfBase}`);
operations: [ operations: [
'echo "vm.swappiness = 1" >>/etc/sysctl.conf', 'echo "vm.swappiness = 1" >>/etc/sysctl.conf',
'sysctl -p', 'sysctl -p',
['pm2 install pm2-logrotate', { retry: true }], // dont retry this as it usually fails
'pm2 set pm2-logrotate:max_size 64M', 'screen -d -m "pm2 install pm2-logrotate && pm2 set pm2-logrotate:max_size 64M"',
], ],
}, },
{ {