nixos-config/packages/tools/system/surface-control/default.nix

42 lines
1.1 KiB
Nix
Raw Normal View History

{
lib
, fetchFromGitHub
2021-09-04 17:26:38 +00:00
, rustPlatform, coreutils
, 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 ];
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
'';
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;
};
}