Merge pull request #72 from DeterminateSystems/package-version

Tie Nix package version to Cargo.toml version
This commit is contained in:
Luc Perkins 2024-05-24 13:15:40 -03:00 committed by GitHub
commit 490776f268
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1,4 +1,6 @@
{ lib, stdenv, rustPlatform { lib
, stdenv
, rustPlatform
, pkg-config , pkg-config
, installShellFiles , installShellFiles
, nix , nix
@ -11,10 +13,11 @@
let let
ignoredPaths = [ ".github" "target" "book" ]; ignoredPaths = [ ".github" "target" "book" ];
version = (builtins.fromTOML (builtins.readFile ./magic-nix-cache/Cargo.toml)).package.version;
in rustPlatform.buildRustPackage rec { in
rustPlatform.buildRustPackage rec {
pname = "magic-nix-cache"; pname = "magic-nix-cache";
version = "0.1.0"; inherit version;
src = lib.cleanSourceWith { src = lib.cleanSourceWith {
filter = name: type: !(type == "directory" && builtins.elem (baseNameOf name) ignoredPaths); filter = name: type: !(type == "directory" && builtins.elem (baseNameOf name) ignoredPaths);
@ -30,7 +33,8 @@ in rustPlatform.buildRustPackage rec {
]; ];
buildInputs = [ buildInputs = [
nix boost nix
boost
] ++ lib.optionals stdenv.isDarwin (with darwin.apple_sdk.frameworks; [ ] ++ lib.optionals stdenv.isDarwin (with darwin.apple_sdk.frameworks; [
SystemConfiguration SystemConfiguration
]); ]);