Parse version
Some checks failed
/ check (push) Failing after 2m26s

This commit is contained in:
Daniel Flanagan 2025-02-12 10:13:04 -06:00
parent ed3698a9ba
commit 6475b87316
2 changed files with 6 additions and 5 deletions

View file

@ -1,5 +1,5 @@
{
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
inputs.git-hooks.url = "github:cachix/git-hooks.nix";
inputs.git-hooks.inputs.nixpkgs.follows = "nixpkgs";
outputs = inputs: let

View file

@ -1,8 +1,11 @@
{pkgs, ...}: let
inherit (builtins) fromTOML readFile;
pname = "my-package";
src = ./..;
main-package = pkgs.rustPlatform.buildRustPackage {
inherit pname;
version = "0.1.0";
inherit pname src;
version = (fromTOML (readFile "${src}/Cargo.toml")).package.version;
# or for workspaces: version = (fromTOML (readFile "${src}/${pname}/Cargo.toml")).package.version;
/*
nativeBuildInputs = with pkgs; [
@ -14,8 +17,6 @@
];
*/
src = ./..;
hash = pkgs.lib.fakeHash;
cargoHash = pkgs.lib.fakeHash;
useFetchCargoVendor = true;
};