1{
2 lib,
3 rustPlatform,
4 fetchFromGitHub,
5 pkg-config,
6 installShellFiles,
7 udev,
8 coreutils,
9}:
10
11rustPlatform.buildRustPackage rec {
12 pname = "surface-control";
13 version = "0.4.8-1";
14
15 src = fetchFromGitHub {
16 owner = "linux-surface";
17 repo = "surface-control";
18 tag = "v${version}";
19 hash = "sha256-ZooqPlvxx+eBFEIf9Y1iU6zhhgafGUw28G5cwdF/E78=";
20 };
21
22 cargoHash = "sha256-gv/ipOQ1kmLc9YxxwuXc/rq6YUdVw2FhrI9C+DHxIDM=";
23
24 nativeBuildInputs = [
25 pkg-config
26 installShellFiles
27 ];
28
29 buildInputs = [ udev ];
30
31 postInstall = ''
32 installShellCompletion \
33 $releaseDir/build/surface-*/out/surface.{bash,fish} \
34 --zsh $releaseDir/build/surface-*/out/_surface
35 '';
36
37 meta = {
38 description = "Control various aspects of Microsoft Surface devices on Linux from the Command-Line";
39 homepage = "https://github.com/linux-surface/surface-control";
40 license = lib.licenses.mit;
41 maintainers = [ ];
42 platforms = lib.platforms.linux;
43 mainProgram = "surface";
44 };
45}