9 rustPlatform.buildRustPackage rec {
10 pname = "supergfxctl";
13 src = fetchFromGitLab {
17 hash = "sha256-AThaZ9dp5T/DtLPE6gZ9qgkw0xksiq+VCL9Y4G41voE=";
20 # fix reported version in Cargo.lock
21 # submitted upstream: https://gitlab.com/asus-linux/supergfxctl/-/merge_requests/31
22 # FIXME: remove for next update
25 url = "https://gitlab.com/asus-linux/supergfxctl/-/commit/8812dd208791d162881d72f785650a3344ec5151.diff";
26 hash = "sha256-eFFj2nIwGXHV1vMIpZvdvFPtfNLDfgqyGRt+VvB03LE=";
30 cargoSha256 = "sha256-gbRGUWfpCQjCxuTdQ+qwOeCDU17G3nNFkIPAgzmeL+E=";
33 substituteInPlace data/supergfxd.service --replace /usr/bin/supergfxd $out/bin/supergfxd
34 substituteInPlace data/99-nvidia-ac.rules --replace /usr/bin/systemctl ${systemd}/bin/systemctl
37 nativeBuildInputs = [ pkg-config ];
38 buildInputs = [ systemd ];
40 # upstream doesn't have tests, don't build twice just to find that out
44 install -Dm444 -t $out/lib/udev/rules.d/ data/*.rules
45 install -Dm444 -t $out/share/dbus-1/system.d/ data/org.supergfxctl.Daemon.conf
46 install -Dm444 -t $out/lib/systemd/system/ data/supergfxd.service
50 description = "A GPU switching utility, mostly for ASUS laptops";
51 homepage = "https://gitlab.com/asus-linux/supergfxctl";
52 license = licenses.mpl20;
53 platforms = [ "x86_64-linux" ];
54 maintainers = [ maintainers.k900 ];