You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
29 lines
748 B
Nix
29 lines
748 B
Nix
2 years ago
|
{ serviceName, binaryPath, errorPath, from, to }:
|
||
|
let
|
||
|
daemon = import ./daemon.nix;
|
||
|
configurationFile = builtins.toFile "error-reporter-config.json" (builtins.toJSON {
|
||
|
errorPath = errorPath;
|
||
|
stackFilter = "*";
|
||
|
subjectFormat = "UNHANDLED ERROR: $type - $message";
|
||
|
metadata = {
|
||
|
from = from;
|
||
|
to = to;
|
||
|
};
|
||
|
});
|
||
|
in { pkgs, lib, ... }: {
|
||
|
imports = [
|
||
|
(daemon {
|
||
|
name = "${serviceName}-error-reporter";
|
||
|
displayName = "${serviceName} Error Reporter";
|
||
|
fakeHome = false;
|
||
|
binaryPath = "${binaryPath} ${configurationFile}";
|
||
|
environmentVariables = {};
|
||
|
prepare = ''
|
||
|
mkdir -m 0700 -p ${errorPath}
|
||
|
chown ${serviceName} ${errorPath}
|
||
|
'';
|
||
|
before = [ "${serviceName}.service" ];
|
||
|
})
|
||
|
];
|
||
|
}
|