Skip to content

Commit

Permalink
nix: only use rev hash if it exists
Browse files Browse the repository at this point in the history
  • Loading branch information
SpiralP committed Dec 31, 2024
1 parent 77cddba commit 87767de
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,16 @@
let
inherit (nixpkgs) lib;

rustManifest = lib.importTOML ./Cargo.toml;

revSuffix = lib.optionalString (self ? shortRev || self ? dirtyShortRev)
"-${self.shortRev or self.dirtyShortRev}";

makePackages = (system: dev:
let
pkgs = import nixpkgs {
inherit system;
};
rustManifest = lib.importTOML ./Cargo.toml;


makeCefBinaryAttrs =
let
Expand Down Expand Up @@ -66,7 +69,7 @@

makeDefaultAttrs = (cef_binary: rec {
pname = rustManifest.package.name;
version = "${rustManifest.package.version}-${self.shortRev or self.dirtyShortRev}";
version = rustManifest.package.version + revSuffix;

src = lib.sourceByRegex ./. [
"^\.cargo(/.*)?$"
Expand Down

0 comments on commit 87767de

Please sign in to comment.