73 lines
1.7 KiB
Nix
73 lines
1.7 KiB
Nix
{ pkgs, lib, config, ... }:
|
|
let
|
|
domain = "support.cloonar.dev";
|
|
user = "support_cloonar_dev";
|
|
|
|
# phpPackage = pkgs.php82.withExtensions ({ enabled, all }:
|
|
# enabled ++ [ all.imagick all.pcntl all.mbstring ]);
|
|
|
|
phpPackage = pkgs.php83.buildEnv {
|
|
extensions = ({ enabled, all }: enabled ++ (with all; [
|
|
imagick
|
|
mbstring
|
|
pcntl
|
|
imap
|
|
gd
|
|
curl
|
|
intl
|
|
zip
|
|
]));
|
|
};
|
|
|
|
in {
|
|
services.webstack.instances."${domain}" = {
|
|
enableDefaultLocations = false;
|
|
enableMysql = true;
|
|
authorizedKeys = [
|
|
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIChPB1wdZUO/VTt2J9e0+mLYhXcsWSL487HNQfmt23vB"
|
|
];
|
|
extraConfig = ''
|
|
add_header X-Frame-Options "SAMEORIGIN";
|
|
add_header X-Content-Type-Options "nosniff";
|
|
|
|
index index.php
|
|
|
|
charset utf-8;
|
|
|
|
error_page 404 /index.php;
|
|
'';
|
|
locations."/favicon.ico".extraConfig = ''
|
|
log_not_found off;
|
|
access_log off;
|
|
'';
|
|
locations."/robots.txt".extraConfig = ''
|
|
access_log off;
|
|
log_not_found off;
|
|
'';
|
|
|
|
locations."/".extraConfig = ''
|
|
try_files $uri $uri/ /index.php$is_args$args;
|
|
'';
|
|
phpPackage = phpPackage;
|
|
};
|
|
|
|
systemd.services."freescout-worker" = {
|
|
enable = true;
|
|
serviceConfig = {
|
|
User = "${user}";
|
|
ExecStart = "${phpPackage}/bin/php /var/www/${domain}/artisan queue:work --queue=emails,default,a5b8cea21bd06d071d2d8da9307d9e04 --sleep=5 --tries=1 --timeout=1800";
|
|
};
|
|
};
|
|
|
|
systemd.services."freescout-cron" = {
|
|
startAt = "*:*";
|
|
wants = [ "freescout-worker.service" ];
|
|
serviceConfig = {
|
|
Type = "oneshot";
|
|
User = "${user}";
|
|
ExecStart = "${phpPackage}/bin/php /var/www/${domain}/artisan schedule:run --no-interaction";
|
|
};
|
|
};
|
|
|
|
}
|