{pkgs, ...}@args: with pkgs.stdenv.lib; let fetchFromCrytoGit = (import ../lib/fetch/from-cryto-git.nix) args; nodeApplication = (import ../lib/node-application.nix) args; createJsonConfiguration = (import ../lib/build/json-configuration.nix) args; in {errorPath, debugMode ? false, rev, sha256}: let configurationFile = createJsonConfiguration { name = "pastebin-stream-configuration.json"; contents = { errors = { directory = errorPath; }; scraperSettings = { pastebinCom = { listInterval = 60; listLimit = 100; pasteInterval = 1; }; }; }; }; in nodeApplication { name = "pastebin-stream"; src = fetchFromCrytoGit { owner = "joepie91"; repo = "pastebin-stream"; inherit rev sha256; }; hasErrorReporting = true; errorPath = errorPath; mainBinaryPath = "bin/pastebin-stream"; setupCommands = '' cp ${configurationFile} $out/config.json ''; serviceConfig = { preStart = '' mkdir -m 0700 -p ${errorPath} chown pastebin-stream ${errorPath} ''; environment = mkIf debugMode { DEBUG = "pastebinStream:*"; }; }; }