Skip to content

Commit 6a59eae

Browse files
committedOct 1, 2024·
Extract Nix package version from Cargo.toml
1 parent c3ec716 commit 6a59eae

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed
 

‎flake.nix

+8-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,14 @@
4141
let pkgs = import nixpkgs { inherit system; };
4242
in pkgs.rustPlatform.buildRustPackage {
4343
pname = "amp";
44-
version = "0.7.0";
44+
45+
# Extract version from Cargo.toml
46+
version = builtins.head
47+
(
48+
builtins.match ".*name = \"amp\"\nversion = \"([^\"]+)\".*"
49+
(builtins.readFile ./Cargo.toml)
50+
);
51+
4552
cargoLock.lockFile = ./Cargo.lock;
4653

4754
# Use source files without version control noise

0 commit comments

Comments
 (0)
Please sign in to comment.