ark/hosts/wolumonde/modules/musikspider.nix

47 lines
1.2 KiB
Nix
Raw Normal View History

2023-05-08 23:09:44 +03:00
{
pkgs,
inputs,
...
2023-05-09 19:04:02 +03:00
}: let
pkg =
inputs.musikspider.packages.${pkgs.system}.musikspider.overrideAttrs
(old: {
LOCAL_MUSIKQUAD_SERVER = "http://localhost:5005";
PUBLIC_MUSIKQUAD_SERVER = "mq.gaze.systems";
PUBLIC_BASEURL = "ms.gaze.systems";
});
in {
users.users.musikspider = {
isSystemUser = true;
group = "musikspider";
};
users.groups.musikspider = {};
2023-05-11 14:14:41 +03:00
systemd.services.musikspider = {
2023-05-09 19:04:02 +03:00
description = "musikspider";
wantedBy = ["multi-user.target"];
after = ["network.target"];
serviceConfig = {
User = "musikspider";
ExecStart = "${pkgs.deno}/bin/deno run --allow-env --allow-read --allow-net ${pkg}/index.js";
Restart = "on-failure";
RestartSec = 5;
WorkingDirectory = "/var/lib/musikspider";
EnvironmentFile = pkgs.writeText "musikspider-env" ''
DENO_NO_UPDATE_CHECK=1
DENO_DIR=/var/lib/musikspider/.deno
PORT=4004
'';
};
};
2023-05-08 23:09:44 +03:00
services.nginx.virtualHosts."ms.gaze.systems" = {
useACMEHost = "gaze.systems";
forceSSL = true;
2023-05-09 19:04:02 +03:00
locations."/" = {
proxyPass = "http://localhost:4004";
proxyWebsockets = true;
};
2023-05-08 23:09:44 +03:00
};
}