feat(rust): add a manifest variable that contains the Cargo.toml values

This commit is contained in:
Reed Krantz
2026-02-21 15:45:21 -06:00
parent c822e1d2eb
commit 95c9a3f192

View File

@@ -27,9 +27,14 @@
systems = ["aarch64-linux" "x86_64-linux" "aarch64-darwin" "x86_64-darwin"];
perSystem = {pkgs, ...}: let
perSystem = {
pkgs,
lib,
...
}: let
craneLib = crane.mkLib pkgs;
src = craneLib.cleanCargoSource ./.;
manifest = (lib.importTOML "${src}/Cargo.toml").package;
# runtime dependencies
buildInputs = with pkgs; [
@@ -66,7 +71,7 @@
programs.alejandra.enable = true;
programs.rustfmt = {
enable = true;
edition = (builtins.fromTOML (builtins.readFile "${src}/Cargo.toml")).package.edition;
edition = manifest.edition;
};
};