Add missing newline and indentation
parent
9deabe3699
commit
a2a7b42ed8
@ -1,48 +1,49 @@
|
||||
{pkgs, config, ...}@args: {src, name, mainBinaryPath, setupCommands ? "", serviceOptions ? {}, serviceConfig ? {}, hasErrorReporting ? false, errorPath ? null}:
|
||||
with pkgs.stdenv.lib;
|
||||
{pkgs, config, ...}@args:
|
||||
{src, name, mainBinaryPath, setupCommands ? "", serviceOptions ? {}, serviceConfig ? {}, hasErrorReporting ? false, errorPath ? null}:
|
||||
with pkgs.stdenv.lib;
|
||||
|
||||
let
|
||||
buildNode2nixPackage = (import ./build/node2nix-package.nix) args;
|
||||
in let
|
||||
serviceName = "node-${name}";
|
||||
cfg = config.services."${serviceName}";
|
||||
let
|
||||
buildNode2nixPackage = (import ./build/node2nix-package.nix) args;
|
||||
in let
|
||||
serviceName = "node-${name}";
|
||||
cfg = config.services."${serviceName}";
|
||||
|
||||
application = buildNode2nixPackage {
|
||||
name = "${serviceName}-source";
|
||||
inherit src setupCommands;
|
||||
};
|
||||
application = buildNode2nixPackage {
|
||||
name = "${serviceName}-source";
|
||||
inherit src setupCommands;
|
||||
};
|
||||
|
||||
errorReporter = (import ./node-error-reporter) args;
|
||||
errorReporterModule = if hasErrorReporting then (errorReporter {
|
||||
application = application;
|
||||
applicationName = name;
|
||||
errorPath = errorPath;
|
||||
}) else null;
|
||||
in {
|
||||
imports = [
|
||||
errorReporterModule
|
||||
];
|
||||
errorReporter = (import ./node-error-reporter) args;
|
||||
errorReporterModule = if hasErrorReporting then (errorReporter {
|
||||
application = application;
|
||||
applicationName = name;
|
||||
errorPath = errorPath;
|
||||
}) else null;
|
||||
in {
|
||||
imports = [
|
||||
errorReporterModule
|
||||
];
|
||||
|
||||
options.services."${serviceName}" = {
|
||||
enable = mkEnableOption "${name}";
|
||||
} // serviceOptions;
|
||||
options.services."${serviceName}" = {
|
||||
enable = mkEnableOption "${name}";
|
||||
} // serviceOptions;
|
||||
|
||||
config = {
|
||||
# FIXME: What if a username conflict occurs?
|
||||
users.extraUsers."${name}" = mkIf cfg.enable {
|
||||
description = "${name} Service User";
|
||||
};
|
||||
config = {
|
||||
# FIXME: What if a username conflict occurs?
|
||||
users.extraUsers."${name}" = mkIf cfg.enable {
|
||||
description = "${name} Service User";
|
||||
};
|
||||
|
||||
systemd.services."${serviceName}" = mkIf cfg.enable ({
|
||||
description = "${name} Service";
|
||||
wantedBy = ["multi-user.target"];
|
||||
after = ["network.target"];
|
||||
systemd.services."${serviceName}" = mkIf cfg.enable ({
|
||||
description = "${name} Service";
|
||||
wantedBy = ["multi-user.target"];
|
||||
after = ["network.target"];
|
||||
|
||||
serviceConfig = {
|
||||
ExecStart = "${application}/${mainBinaryPath}";
|
||||
User = name;
|
||||
PermissionsStartOnly = true;
|
||||
};
|
||||
} // serviceConfig);
|
||||
};
|
||||
}
|
||||
serviceConfig = {
|
||||
ExecStart = "${application}/${mainBinaryPath}";
|
||||
User = name;
|
||||
PermissionsStartOnly = true;
|
||||
};
|
||||
} // serviceConfig);
|
||||
};
|
||||
}
|
||||
|
Loading…
Reference in New Issue