Merge pull request #11 from basvandijk/cargolock-cargotoml-via-file

Pass cargolock/cargotoml via file instead of via env var
This commit is contained in:
Nicolas Mattia 2019-08-26 11:30:38 +02:00 committed by GitHub
commit 95cf3bb609
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 5 deletions

View file

@ -122,7 +122,7 @@ with rec
then
echo "WARNING: replacing existing Cargo.lock"
fi
echo "$cargolock" > Cargo.lock
install -m 644 "$cargolock" Cargo.lock
fi
if [ -n "$cargotoml" ]
@ -132,7 +132,7 @@ with rec
then
echo "WARNING: replacing existing Cargo.toml"
fi
echo "$cargotoml" > Cargo.toml
install -m 644 "$cargotoml" Cargo.toml
fi
mkdir -p target
@ -245,9 +245,9 @@ with rec
'';
} //
lib.optionalAttrs (! isNull cargolock )
{ cargolock = builtinz.toTOML cargolock; } //
{ cargolock = builtinz.writeTOML "Cargo.lock" cargolock; } //
lib.optionalAttrs (! isNull cargotoml )
{ cargotoml = builtinz.toTOML cargotoml; }
{ cargotoml = builtinz.writeTOML "Cargo.toml" cargotoml; }
)
;

View file

@ -8,7 +8,7 @@
rec
{
toTOML = import ./to-toml.nix { inherit lib; };
writeTOML = attrs: writeText "write-toml" (toTOML attrs);
writeTOML = name: attrs: writeText name (toTOML attrs);
readTOML = usePure: f:
if usePure then