Create lib.runDhallCommand
An optimization for using the Dhall library.
This commit is contained in:
parent
5229395e9a
commit
b01c8fd51d
|
@ -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\""
|
||||
'';
|
||||
|
|
Loading…
Reference in New Issue