1
Fork 0
mirror of https://github.com/RGBCube/alejandra synced 2025-07-31 04:27:45 +00:00

feat: dynamic versioning

This commit is contained in:
Kevin Amado 2022-01-27 23:54:17 -05:00
parent d2709594da
commit c671ef15fc
No known key found for this signature in database
GPG key ID: FFF341057F503148
3 changed files with 10 additions and 5 deletions

View file

@ -24,7 +24,12 @@
nixpkgs.rustPlatform.buildRustPackage
{
pname = cargoToml.package.name;
version = inputs.self.sourceInfo.rev;
version =
let
commit = inputs.self.shortRev or "dirty";
date = inputs.self.lastModifiedDate or inputs.self.lastModified or "19700101";
in
"${ builtins.substring 0 8 date }_${ commit }";
src = inputs.self.sourceInfo;
cargoLock.lockFile = ./Cargo.lock;
NIX_BUILD_CORES = 0;