Skip to content

Commit

Permalink
Extract Nix package version from Cargo.toml
Browse files Browse the repository at this point in the history
  • Loading branch information
jmacdonald committed Oct 1, 2024
1 parent c3ec716 commit bd2b6df
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,14 @@
let pkgs = import nixpkgs { inherit system; };
in pkgs.rustPlatform.buildRustPackage {
pname = "amp";
version = "0.7.0";

# Extract the version from the Rust project
version = builtins.head
(
builtins.match "version = \"([^\"]+)\""
(builtins.readFile ./Cargo.toml)
);

cargoLock.lockFile = ./Cargo.lock;

# Use source files without version control noise
Expand Down

0 comments on commit bd2b6df

Please sign in to comment.