feat(rust): add a manifest variable that contains the Cargo.toml values
This commit is contained in:
@@ -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;
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user