29 lines
619 B
Nix
29 lines
619 B
Nix
{ config, pkgs, ... }:
|
|
|
|
let
|
|
msjd = builtins.getFlake "${config.users.users."me".home}/main/msjd";
|
|
in
|
|
{
|
|
systemd.services.msjd = {
|
|
description = "Msjd";
|
|
after = [ "network.target" ];
|
|
wantedBy = [ "multi-user.target" ];
|
|
|
|
serviceConfig = {
|
|
WorkingDirectory = msjd.packages.x86_64-linux.default;
|
|
ExecStart = "${pkgs.nodejs}/bin/node ${msjd.packages.x86_64-linux.default}/index.mjs";
|
|
|
|
User = "me";
|
|
Restart = "always";
|
|
RestartSec = 3;
|
|
|
|
Environment = [
|
|
"NODE_ENV=production"
|
|
"PORT=3709"
|
|
];
|
|
|
|
EnvironmentFile = "/run/secrets.env";
|
|
};
|
|
};
|
|
}
|