Read nix package name and version from Cargo.toml

This commit is contained in:
Skye 2024-11-14 16:53:43 -05:00
parent d41aa2ab41
commit c642e25256

View file

@ -11,10 +11,12 @@
devShells."${system}".default = devShells."${system}".default =
pkgs.mkShell { packages = [ pkgs.mkvtoolnix-cli ]; }; pkgs.mkShell { packages = [ pkgs.mkvtoolnix-cli ]; };
overlays.default = final: prev: { overlays.default = final: prev:
let cargo-toml = builtins.fromTOML (builtins.readFile ./Cargo.toml);
in {
subtitle-merge = final.rustPlatform.buildRustPackage { subtitle-merge = final.rustPlatform.buildRustPackage {
name = "subtitle-merge"; pname = cargo-toml.package.name;
version = "0.1"; version = cargo-toml.package.version;
src = ./.; src = ./.;
cargoLock.lockFile = ./Cargo.lock; cargoLock.lockFile = ./Cargo.lock;
buildInputs = builtins.attrValues { buildInputs = builtins.attrValues {