biome: 1.9.2 -> 1.9.3
[NixPkgs.git] / pkgs / applications / misc / surface-control / default.nix
blob6c82c6efe96e3f35b6dde9e5b591859559b72126
1 { lib, rustPlatform, fetchFromGitHub, pkg-config, installShellFiles, udev, coreutils }:
3 rustPlatform.buildRustPackage rec {
4   pname = "surface-control";
5   version = "0.4.3-2";
7   src = fetchFromGitHub {
8     owner = "linux-surface";
9     repo = pname;
10     rev = "v${version}";
11     sha256 = "sha256-QgkUxT5Ae0agvalZl1ie+1LwxgaTzMrKpQY3KkpWwG4=";
12   };
14   cargoLock = {
15     lockFile = ./Cargo.lock;
16     outputHashes = {
17       "sdtx-0.1.3" = "sha256-srYSVXRP/rynhhE3ZfOGRM6c7GDgjfmjO/GLXeTze3A=";
18     };
19   };
21   nativeBuildInputs = [ pkg-config installShellFiles ];
22   buildInputs = [ udev ];
24   postInstall = ''
25     installShellCompletion \
26       $releaseDir/build/surface-*/out/surface.{bash,fish} \
27       --zsh $releaseDir/build/surface-*/out/_surface
28     install -Dm 0444 -t $out/etc/udev/rules.d \
29       etc/udev/40-surface-control.rules
30     substituteInPlace $out/etc/udev/rules.d/40-surface-control.rules \
31       --replace "/usr/bin/chmod" "${coreutils}/bin/chmod" \
32       --replace "/usr/bin/chown" "${coreutils}/bin/chown"
33   '';
35   meta = with lib; {
36     description =
37       "Control various aspects of Microsoft Surface devices on Linux from the Command-Line";
38     homepage = "https://github.com/linux-surface/surface-control";
39     license = licenses.mit;
40     maintainers = [ ];
41     platforms = platforms.linux;
42     mainProgram = "surface";
43   };