diff --git a/lib/node-application.nix b/lib/node-application.nix index 09cab0a..60a90da 100644 --- a/lib/node-application.nix +++ b/lib/node-application.nix @@ -16,35 +16,35 @@ }; errorReporterModule = optionalValue hasErrorReporting (errorReporter { - application = application; applicationName = name; - errorPath = errorPath; + inherit application errorPath; }); - in { - imports = [ - errorReporterModule - ]; + 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); + }; + }