2020-08-17 03:03:32 +02:00
|
|
|
{ pkgs, depot, ... }:
|
|
|
|
|
|
|
|
let
|
|
|
|
pathScripts = pkgs.writeShellScript "imports" ''
|
2020-08-21 03:15:33 +02:00
|
|
|
export tvix_instantiate="${depot.third_party.nix}/bin/nix-instantiate"
|
|
|
|
export depot_scanner="${depot.tools.depot-scanner}/bin/depot-scanner"
|
2020-08-17 03:03:32 +02:00
|
|
|
'';
|
|
|
|
|
|
|
|
# setup: git rev-parse --show-toplevel > $tvlc_root/depot_root
|
|
|
|
# setup: mkdir $tvlc_root/clients
|
|
|
|
# setup: echo 1 > $tvlc_root/next_clientid
|
|
|
|
|
2020-08-21 03:15:33 +02:00
|
|
|
commonsh = pkgs.stdenv.mkDerivation {
|
|
|
|
name = "common.sh";
|
|
|
|
src = ./common.sh;
|
|
|
|
doCheck = true;
|
|
|
|
unpackPhase = "true";
|
|
|
|
buildPhase = ''
|
|
|
|
substitute ${./common.sh} $out --replace path-scripts ${pathScripts}
|
|
|
|
'';
|
|
|
|
checkPhase = ''
|
|
|
|
${pkgs.shellcheck}/bin/shellcheck $out ${pathScripts} && echo "SHELLCHECK OK"
|
|
|
|
'';
|
|
|
|
installPhase = ''
|
|
|
|
chmod +x $out
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
2020-08-17 03:03:32 +02:00
|
|
|
tvlcNew = pkgs.stdenv.mkDerivation {
|
|
|
|
name = "tvlc-new";
|
|
|
|
src = ./tvlc-new;
|
|
|
|
doCheck = true;
|
|
|
|
|
|
|
|
unpackPhase = "true";
|
|
|
|
buildPhase = ''
|
|
|
|
substitute ${./tvlc-new} $out --replace common.sh ${commonsh}
|
|
|
|
'';
|
|
|
|
checkPhase = ''
|
2020-08-21 03:15:33 +02:00
|
|
|
${pkgs.shellcheck}/bin/shellcheck $out ${commonsh} ${pathScripts} && echo "SHELLCHECK OK"
|
2020-08-17 03:03:32 +02:00
|
|
|
'';
|
|
|
|
installPhase = ''
|
|
|
|
chmod +x $out
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
2022-01-30 17:06:58 +01:00
|
|
|
in
|
|
|
|
{
|
2020-08-21 03:15:33 +02:00
|
|
|
inherit pathScripts;
|
2020-08-17 03:03:32 +02:00
|
|
|
inherit commonsh;
|
|
|
|
inherit tvlcNew;
|
|
|
|
}
|