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.
|
|
|
{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
|
|
|
|
configuration = {
|
|
|
|
errors = {
|
|
|
|
directory = errorPath;
|
|
|
|
};
|
|
|
|
|
|
|
|
scraperSettings = {
|
|
|
|
pastebinCom = {
|
|
|
|
listInterval = 60;
|
|
|
|
listLimit = 100;
|
|
|
|
pasteInterval = 1;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
configurationFile = createJsonConfiguration {
|
|
|
|
name = "pastebin-stream-configuration.json";
|
|
|
|
contents = configuration;
|
|
|
|
};
|
|
|
|
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:*";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|