Skip to content

Commit

Permalink
Extract package name and version from Cargo.toml (#136)
Browse files Browse the repository at this point in the history
* chore: nix flake update

* feat: Extract package name and version from Cargo.toml
  • Loading branch information
ICE-GB committed May 22, 2024
1 parent e6d4585 commit 5fd3b71
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 11 deletions.
12 changes: 6 additions & 6 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 9 additions & 5 deletions nix/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -23,7 +27,7 @@ rustPlatform.buildRustPackage {
];

src = builtins.path {
name = "lan-mouse";
name = pname;
path = lib.cleanSource ../.;
};

Expand All @@ -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;
};
}

0 comments on commit 5fd3b71

Please sign in to comment.