nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 stdenv,
3 rustPlatform,
4 fetchFromGitHub,
5 lib,
6 glib,
7 gtk4,
8 libadwaita,
9 libX11,
10 libXtst,
11 pkg-config,
12 wrapGAppsHook4,
13}:
14
15rustPlatform.buildRustPackage rec {
16 pname = "lan-mouse";
17 version = "0.10.0";
18
19 src = fetchFromGitHub {
20 owner = "feschber";
21 repo = "lan-mouse";
22 rev = "v${version}";
23 hash = "sha256-ofiNgJbmf35pfRvZB3ZmMkCJuM7yYgNL+Dd5mZZqyNk=";
24 };
25
26 # lan-mouse uses `git` to determine the version at build time and
27 # has Cargo set the `GIT_DESCRIBE` environment variable. To improve
28 # build reproducibility, we define the variable based on the package
29 # version instead.
30 prePatch = ''
31 rm build.rs
32 '';
33 env = {
34 GIT_DESCRIBE = "${version}-nixpkgs";
35 };
36
37 nativeBuildInputs = [
38 pkg-config
39 wrapGAppsHook4
40 ];
41
42 buildInputs = [
43 glib
44 gtk4
45 libadwaita
46 libX11
47 libXtst
48 ];
49
50 cargoHash = "sha256-+UXRBYfbkb114mwDGj36oG5ZT3TQtcEzsbyZvtWTMxM=";
51
52 postInstall = ''
53 install -Dm444 de.feschber.LanMouse.desktop -t $out/share/applications
54 install -Dm444 lan-mouse-gtk/resources/de.feschber.LanMouse.svg -t $out/share/icons/hicolor/scalable/apps
55 '';
56
57 meta = {
58 description = "Software KVM switch for sharing a mouse and keyboard with multiple hosts through the network";
59 homepage = "https://github.com/feschber/lan-mouse";
60 changelog = "https://github.com/feschber/lan-mouse/releases/tag/v${version}";
61 license = lib.licenses.gpl3Only;
62 mainProgram = "lan-mouse";
63 maintainers = with lib.maintainers; [ pedrohlc ];
64 platforms = lib.platforms.unix ++ lib.platforms.windows;
65 };
66}