|
|
@ -16,35 +16,35 @@
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
errorReporterModule = optionalValue hasErrorReporting (errorReporter {
|
|
|
|
errorReporterModule = optionalValue hasErrorReporting (errorReporter {
|
|
|
|
application = application;
|
|
|
|
|
|
|
|
applicationName = name;
|
|
|
|
applicationName = name;
|
|
|
|
errorPath = errorPath;
|
|
|
|
inherit application errorPath;
|
|
|
|
});
|
|
|
|
});
|
|
|
|
in {
|
|
|
|
in
|
|
|
|
imports = [
|
|
|
|
{
|
|
|
|
errorReporterModule
|
|
|
|
imports = [
|
|
|
|
];
|
|
|
|
errorReporterModule
|
|
|
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
|
|
options.services."${serviceName}" = {
|
|
|
|
options.services."${serviceName}" = {
|
|
|
|
enable = mkEnableOption "${name}";
|
|
|
|
enable = mkEnableOption "${name}";
|
|
|
|
} // serviceOptions;
|
|
|
|
} // serviceOptions;
|
|
|
|
|
|
|
|
|
|
|
|
config = {
|
|
|
|
config = {
|
|
|
|
# FIXME: What if a username conflict occurs?
|
|
|
|
# FIXME: What if a username conflict occurs?
|
|
|
|
users.extraUsers."${name}" = mkIf cfg.enable {
|
|
|
|
users.extraUsers."${name}" = mkIf cfg.enable {
|
|
|
|
description = "${name} Service User";
|
|
|
|
description = "${name} Service User";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
systemd.services."${serviceName}" = mkIf cfg.enable ({
|
|
|
|
systemd.services."${serviceName}" = mkIf cfg.enable ({
|
|
|
|
description = "${name} Service";
|
|
|
|
description = "${name} Service";
|
|
|
|
wantedBy = ["multi-user.target"];
|
|
|
|
wantedBy = ["multi-user.target"];
|
|
|
|
after = ["network.target"];
|
|
|
|
after = ["network.target"];
|
|
|
|
|
|
|
|
|
|
|
|
serviceConfig = {
|
|
|
|
serviceConfig = {
|
|
|
|
ExecStart = "${application}/${mainBinaryPath}";
|
|
|
|
ExecStart = "${application}/${mainBinaryPath}";
|
|
|
|
User = name;
|
|
|
|
User = name;
|
|
|
|
PermissionsStartOnly = true;
|
|
|
|
PermissionsStartOnly = true;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
} // serviceConfig);
|
|
|
|
} // serviceConfig);
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|
|
|
|
}
|
|
|
|