2
0
Fork 0

Create lib.runDhallCommand

An optimization for using the Dhall library.
This commit is contained in:
Ehmry - 2020-04-09 16:19:38 +05:30
parent 5229395e9a
commit b01c8fd51d
1 changed files with 10 additions and 18 deletions

View File

@ -9,34 +9,26 @@ let
in rec {
linuxScript = name: env: bootDhall:
buildPackages.runCommand name ({
inherit name;
buildInputs = [ buildPackages.dhall ];
DHALL_GENODE = "${testPkgs.dhallGenode}/binary.dhall";
} // env) ''
runDhallCommand = name: env: script:
nixpkgs.runCommand name
({ nativeBuildInputs = [ buildPackages.dhall ]; } // env) ''
export XDG_CACHE_HOME=$NIX_BUILD_TOP
export DHALL_GENODE="${testPkgs.dhallGenode}/binary.dhall";
${buildPackages.xorg.lndir}/bin/lndir -silent \
${testPkgs.dhallGenode}/.cache \
$XDG_CACHE_HOME
${script}
'';
linuxScript = name: env: bootDhall:
runDhallCommand name env ''
dhall to-directory-tree --output $out \
<<< "${./linux-script.dhall} (${bootDhall}) \"$out\""
'';
compileBoot = name: env: bootDhall:
buildPackages.runCommand name ({
inherit name;
buildInputs = [ buildPackages.dhall ];
DHALL_GENODE = "${testPkgs.dhallGenode}/binary.dhall";
} // env) ''
export XDG_CACHE_HOME=$NIX_BUILD_TOP
${buildPackages.xorg.lndir}/bin/lndir -silent \
${testPkgs.dhallGenode}/.cache \
$XDG_CACHE_HOME
runDhallCommand name env ''
dhall to-directory-tree --output $out \
<<< "${./compile-boot.dhall} (${bootDhall}) \"$out\""
'';