31 lines
853 B
Nix
31 lines
853 B
Nix
{ inputs, pkgs, ... }:
|
|
|
|
{
|
|
systemd.services.cfwithoutincident = {
|
|
description = "Cloudflare Status D-Day dashboard";
|
|
after = [ "network-online.target" ];
|
|
wants = [ "network-online.target" ];
|
|
wantedBy = [ "multi-user.target" ];
|
|
|
|
serviceConfig = {
|
|
Type = "simple";
|
|
User = "imnyang";
|
|
Group = "users";
|
|
WorkingDirectory = "/var/lib/cfwithoutincident";
|
|
Environment = [
|
|
"PORT=31774"
|
|
];
|
|
ExecStartPre = [
|
|
"${pkgs.coreutils}/bin/cp -r ${inputs.cfwithoutincident}/. /var/lib/cfwithoutincident/"
|
|
"${pkgs.bun}/bin/bun install --frozen-lockfile"
|
|
];
|
|
ExecStart = "${pkgs.bun}/bin/bun run src/index.ts";
|
|
Restart = "always";
|
|
RestartSec = 5;
|
|
StateDirectory = "cfwithoutincident";
|
|
StateDirectoryMode = "0755";
|
|
};
|
|
|
|
path = [ pkgs.bun ];
|
|
};
|
|
}
|