42 lines
1.1 KiB
Nix
42 lines
1.1 KiB
Nix
{
|
|
lib
|
|
, fetchFromGitHub
|
|
, 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";
|
|
};
|
|
|
|
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
|
|
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;
|
|
};
|
|
}
|