2021-09-03 12:50:30 +00:00
|
|
|
{
|
|
|
|
lib
|
|
|
|
, fetchFromGitHub
|
2021-09-04 17:26:38 +00:00
|
|
|
, rustPlatform, coreutils
|
2021-09-03 12:50:30 +00:00
|
|
|
, pkg-config, udev
|
|
|
|
}:
|
|
|
|
|
|
|
|
rustPlatform.buildRustPackage rec {
|
|
|
|
pname = "surface-control";
|
|
|
|
version = "0.4.1-1";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "linux-surface";
|
|
|
|
repo = "surface-control";
|
|
|
|
rev = "v${version}";
|
|
|
|
sha256 = "0606imcz38kcfxcjs00j3va7j7i8fzr4mcspyh5d6jrwwgl1xjxb";
|
|
|
|
};
|
|
|
|
|
2021-09-04 17:26:38 +00:00
|
|
|
patches = [ ./0000-nixos-chmod.patch ];
|
|
|
|
|
2021-09-03 12:50:30 +00:00
|
|
|
cargoSha256 = "1yqwaba1rkm3kw1py87j23q4jbdhdsx6fmqidzxgqhr7awrq763y";
|
|
|
|
|
|
|
|
nativeBuildInputs = [ pkg-config ];
|
|
|
|
buildInputs = [ udev ];
|
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
mkdir -p $out/lib/udev/rules.d/
|
|
|
|
cp etc/udev/40-surface-control.rules $out/lib/udev/rules.d/40-surface-control.rules
|
2021-09-04 17:26:38 +00:00
|
|
|
sed -e "s|@CHMODBINARY@|${coreutils}/bin/chmod|g" --in-place $out/lib/udev/rules.d/40-surface-control.rules
|
2021-09-03 12:50:30 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
doCheck = false;
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Control various aspects of Microsoft Surface devices on Linux from the Command-Line.";
|
|
|
|
homepage = "https://github.com/linux-surface/surface-control";
|
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = [];
|
|
|
|
platforms = platforms.linux;
|
|
|
|
};
|
|
|
|
}
|