refactor(flake): read version from Cargo.toml

Extract version from Cargo.toml using builtins.fromTOML as single
source of truth instead of hardcoding "0.1.0" in derivations.
This commit is contained in:
Konstantin Fickel 2026-04-02 22:54:11 +02:00 committed by kfickel
parent 02c2310d53
commit 9d1b47d19e

View file

@ -30,6 +30,9 @@
inherit (nixpkgs) lib; inherit (nixpkgs) lib;
forAllSystems = lib.genAttrs lib.systems.flakeExposed; forAllSystems = lib.genAttrs lib.systems.flakeExposed;
# Read version from Cargo.toml as single source of truth
version = (builtins.fromTOML (builtins.readFile ./Cargo.toml)).package.version;
mkPkgs = mkPkgs =
system: system:
import nixpkgs { import nixpkgs {
@ -58,7 +61,7 @@
commonArgs = { commonArgs = {
src = craneLib.path ./.; src = craneLib.path ./.;
pname = "streamd"; pname = "streamd";
version = "0.1.0"; inherit version;
strictDeps = true; strictDeps = true;
}; };