36 lines
888 B
Nix
36 lines
888 B
Nix
{
|
|
self,
|
|
pkgs,
|
|
stdenv,
|
|
lib,
|
|
writers,
|
|
writeScriptBin,
|
|
nodejs,
|
|
fetchurl,
|
|
model ? null,
|
|
serverUrl ? "",
|
|
local ? true,
|
|
...
|
|
}:
|
|
writeScriptBin "conmorfeusz" ''
|
|
#!/${nodejs}/bin/node
|
|
// Passed from Nix derivation config
|
|
const MORFEUSZ_ANALYSER_BIN="${self.packages.${stdenv.hostPlatform.system}.morfeusz}/bin/morfeusz_analyzer";
|
|
const MORFEUSZ_GENERATOR_BIN="${self.packages.${stdenv.hostPlatform.system}.morfeusz}/bin/morfeusz_generator";
|
|
const CONCRAFT_BIN="${self.packages.${stdenv.hostPlatform.system}.concraft-pl}/bin/concraft-pl";
|
|
const CONCRAFT_MODEL="${
|
|
if model != null
|
|
then model
|
|
else pkgs.callPackage ./concraft-sgjp-model.nix {}
|
|
}";
|
|
const CONCRAFT_SERVER_URL="${serverUrl}";
|
|
const CONCRAFT_MODE="${
|
|
if local
|
|
then "local"
|
|
else "remote"
|
|
}";
|
|
// =================================
|
|
|
|
${builtins.readFile ./index.js}
|
|
''
|