iosevka: Allow privateBuildPlan to be a path

This commit is contained in:
Daniel Nagy 2022-07-15 09:21:46 +02:00 committed by Damien Cassou
parent 0e0cc47192
commit d51f8eeca9
No known key found for this signature in database
GPG Key ID: B68746238E59B548

View File

@ -80,16 +80,23 @@ stdenv.mkDerivation rec {
else privateBuildPlan;
inherit extraParameters;
passAsFile = [ "buildPlan" "extraParameters" ];
passAsFile = [
"extraParameters"
] ++ lib.optional (! (builtins.isString privateBuildPlan && lib.hasPrefix builtins.storeDir privateBuildPlan)) [
"buildPlan"
];
configurePhase = ''
runHook preConfigure
${lib.optionalString (builtins.isAttrs privateBuildPlan) ''
remarshal -i "$buildPlanPath" -o private-build-plans.toml -if json -of toml
''}
${lib.optionalString (builtins.isString privateBuildPlan) ''
${lib.optionalString (builtins.isString privateBuildPlan && (!lib.hasPrefix builtins.storeDir privateBuildPlan)) ''
cp "$buildPlanPath" private-build-plans.toml
''}
${lib.optionalString (builtins.isString privateBuildPlan && (lib.hasPrefix builtins.storeDir privateBuildPlan)) ''
cp "$buildPlan" private-build-plans.toml
''}
${lib.optionalString (extraParameters != null) ''
echo -e "\n" >> params/parameters.toml
cat "$extraParametersPath" >> params/parameters.toml