Extract package name and version from Cargo.toml (#136)

* chore: nix flake update

* feat: Extract package name and version from Cargo.toml
This commit is contained in:
虢豳
2024-05-22 14:06:44 +08:00
committed by GitHub
parent e6d4585bb2
commit 5fd3b719d6
2 changed files with 15 additions and 11 deletions

View File

@@ -2,10 +2,14 @@
rustPlatform,
lib,
pkgs,
}:
}: let
cargoToml = builtins.fromTOML (builtins.readFile ../Cargo.toml);
pname = cargoToml.package.name;
version = cargoToml.package.version;
in
rustPlatform.buildRustPackage {
pname = "lan-mouse";
version = "0.7.0";
pname = pname;
version = version;
nativeBuildInputs = with pkgs; [
pkg-config
@@ -23,7 +27,7 @@ rustPlatform.buildRustPackage {
];
src = builtins.path {
name = "lan-mouse";
name = pname;
path = lib.cleanSource ../.;
};
@@ -38,7 +42,7 @@ rustPlatform.buildRustPackage {
Lan Mouse is a mouse and keyboard sharing software similar to universal-control on Apple devices. It allows for using multiple pcs with a single set of mouse and keyboard. This is also known as a Software KVM switch.
The primary target is Wayland on Linux but Windows and MacOS and Linux on Xorg have partial support as well (see below for more details).
'';
mainProgram = "lan-mouse";
mainProgram = pname;
platforms = platforms.all;
};
}