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 {
|
in rec {
|
||||||
|
|
||||||
linuxScript = name: env: bootDhall:
|
runDhallCommand = name: env: script:
|
||||||
buildPackages.runCommand name ({
|
nixpkgs.runCommand name
|
||||||
inherit name;
|
({ nativeBuildInputs = [ buildPackages.dhall ]; } // env) ''
|
||||||
buildInputs = [ buildPackages.dhall ];
|
|
||||||
DHALL_GENODE = "${testPkgs.dhallGenode}/binary.dhall";
|
|
||||||
} // env) ''
|
|
||||||
export XDG_CACHE_HOME=$NIX_BUILD_TOP
|
export XDG_CACHE_HOME=$NIX_BUILD_TOP
|
||||||
|
export DHALL_GENODE="${testPkgs.dhallGenode}/binary.dhall";
|
||||||
${buildPackages.xorg.lndir}/bin/lndir -silent \
|
${buildPackages.xorg.lndir}/bin/lndir -silent \
|
||||||
${testPkgs.dhallGenode}/.cache \
|
${testPkgs.dhallGenode}/.cache \
|
||||||
$XDG_CACHE_HOME
|
$XDG_CACHE_HOME
|
||||||
|
|
||||||
|
${script}
|
||||||
|
'';
|
||||||
|
|
||||||
|
linuxScript = name: env: bootDhall:
|
||||||
|
runDhallCommand name env ''
|
||||||
dhall to-directory-tree --output $out \
|
dhall to-directory-tree --output $out \
|
||||||
<<< "${./linux-script.dhall} (${bootDhall}) \"$out\""
|
<<< "${./linux-script.dhall} (${bootDhall}) \"$out\""
|
||||||
'';
|
'';
|
||||||
|
|
||||||
compileBoot = name: env: bootDhall:
|
compileBoot = name: env: bootDhall:
|
||||||
buildPackages.runCommand name ({
|
runDhallCommand name env ''
|
||||||
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
|
|
||||||
|
|
||||||
dhall to-directory-tree --output $out \
|
dhall to-directory-tree --output $out \
|
||||||
<<< "${./compile-boot.dhall} (${bootDhall}) \"$out\""
|
<<< "${./compile-boot.dhall} (${bootDhall}) \"$out\""
|
||||||
'';
|
'';
|
||||||
|
|
Loading…
Reference in New Issue
Block a user