Extract version number programmatically

This commit is contained in:
Thomas Zahner 2024-12-19 22:00:10 +01:00
parent a8e648a2c7
commit 38645a1c1c

View file

@ -1,10 +1,16 @@
{ pkgs }:
let
version =
let
cargoToml = builtins.readFile ./Cargo.toml;
match = builtins.match ''.*version = "([^"]+)".*'' cargoToml;
in
if match != null then builtins.elemAt match 0 else throw "Version not found in Cargo.toml";
in
{
app = pkgs.rustPlatform.buildRustPackage {
pname = "lychee";
version = "0.17.0";
inherit version;
src = ./.;
cargoLock = {