mirror of
https://github.com/nix-community/dream2nix.git
synced 2024-08-16 18:00:30 +03:00
move translator cli to src/apps
This commit is contained in:
parent
2ce1ddb6f3
commit
7ef59b51d5
@ -1,18 +1,22 @@
|
||||
{
|
||||
pkgs,
|
||||
location,
|
||||
translators,
|
||||
}:
|
||||
let
|
||||
callPackage = pkgs.callPackage;
|
||||
in
|
||||
{
|
||||
# translate cli
|
||||
translate = callPackage ({ writeScript, }:
|
||||
writeScript
|
||||
"translate"
|
||||
''${import ../translators { inherit pkgs; }}/bin/cli "$@"''
|
||||
|
||||
# the unified translator cli
|
||||
translate = callPackage ({ python3, writeScript, ... }:
|
||||
writeScript "cli" ''
|
||||
translatorsJsonFile=${translators.translatorsJsonFile} \
|
||||
${python3}/bin/python ${./translators-cli.py} "$@"
|
||||
''
|
||||
) {};
|
||||
|
||||
# install the framework to a specified location by copying the code
|
||||
install = callPackage ({ writeScript, }:
|
||||
writeScript
|
||||
"install"
|
||||
|
@ -8,7 +8,7 @@ in
|
||||
|
||||
rec {
|
||||
|
||||
apps = callPackage ./apps { inherit location; };
|
||||
apps = callPackage ./apps { inherit location translators; };
|
||||
|
||||
builders = callPackage ./builders {};
|
||||
|
||||
|
@ -26,6 +26,8 @@ let
|
||||
# Put all translator executables in a json file.
|
||||
# This will allow the cli to call the translators of different build systems
|
||||
# in a standardised way
|
||||
# TODO: This doesn't scale as it requires all translators being built.
|
||||
# Redesign this, to call the individual translators using nix run ...
|
||||
translatorsJsonFile = callPackage ({ bash, lib, runCommand, ... }:
|
||||
runCommand
|
||||
"translators.json"
|
||||
@ -47,10 +49,6 @@ let
|
||||
) {};
|
||||
|
||||
in
|
||||
|
||||
# the unified translator cli
|
||||
callPackage ({ python3, writeScriptBin, ... }:
|
||||
writeScriptBin "cli" ''
|
||||
translatorsJsonFile=${translatorsJsonFile} ${python3}/bin/python ${./cli.py} "$@"
|
||||
''
|
||||
) {}
|
||||
{
|
||||
inherit translators translatorsJsonFile;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user