From 95c9a3f1928c4ce714780072c9cd7d9b865d2097 Mon Sep 17 00:00:00 2001 From: Reed Krantz Date: Sat, 21 Feb 2026 15:45:21 -0600 Subject: [PATCH] feat(rust): add a manifest variable that contains the Cargo.toml values --- rust/flake.nix | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/rust/flake.nix b/rust/flake.nix index 8159481..1274973 100644 --- a/rust/flake.nix +++ b/rust/flake.nix @@ -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; }; };