2019-11-05 11:57:05 +01:00
|
|
|
{
|
|
|
|
# Plumbing tools:
|
2020-01-09 17:02:17 +01:00
|
|
|
closureInfo
|
|
|
|
, runCommand
|
|
|
|
, writeText
|
|
|
|
, buildEnv
|
|
|
|
, # Actual dependencies to propagate:
|
|
|
|
bash
|
|
|
|
, coreutils
|
|
|
|
}:
|
2019-11-05 11:57:05 +01:00
|
|
|
let
|
|
|
|
tools = buildEnv {
|
|
|
|
name = "lorri-runtime-tools";
|
|
|
|
paths = [ coreutils bash ];
|
|
|
|
};
|
|
|
|
|
|
|
|
runtimeClosureInfo = closureInfo {
|
|
|
|
rootPaths = [ tools ];
|
|
|
|
};
|
|
|
|
|
|
|
|
closureToNix = runCommand "closure.nix" {}
|
2020-01-09 17:02:17 +01:00
|
|
|
''
|
|
|
|
(
|
|
|
|
echo '{ dep, ... }: ['
|
|
|
|
sed -E 's/^(.*)$/ (dep \1)/' ${runtimeClosureInfo}/store-paths
|
|
|
|
echo ']'
|
|
|
|
) > $out
|
|
|
|
'';
|
2019-11-05 11:57:05 +01:00
|
|
|
|
|
|
|
runtimeClosureInfoAsNix = runCommand "runtime-closure.nix" {
|
|
|
|
runtime_closure_list = closureToNix;
|
|
|
|
tools_build_host = tools;
|
|
|
|
}
|
2020-01-09 17:02:17 +01:00
|
|
|
''
|
|
|
|
substituteAll ${./runtime-closure.nix.template} $out
|
|
|
|
'';
|
|
|
|
in
|
|
|
|
runtimeClosureInfoAsNix
|