1 { pkg-config, libusb1, dbus, lib, rustPlatform, fetchFromGitHub }:
3 rustPlatform.buildRustPackage rec {
4 pname = "system76-power";
7 src = fetchFromGitHub {
9 repo = "system76-power";
11 hash = "sha256-Ju4xIWOf6m8z1fUSbzafKkyt9XXT8q1/8RukrhtswsE=";
14 nativeBuildInputs = [ pkg-config ];
15 buildInputs = [ dbus libusb1 ];
18 lockFile = ./Cargo.lock;
20 "sysfs-class-0.1.3" = "sha256-ztfwfCRAkxUd/LLNG5fpVuFdgX+tCKL3F35qYJ2GDm8=";
25 install -D -m 0644 data/com.system76.PowerDaemon.conf $out/etc/dbus-1/system.d/com.system76.PowerDaemon.conf
26 install -D -m 0644 data/com.system76.PowerDaemon.policy $out/share/polkit-1/actions/com.system76.PowerDaemon.policy
27 install -D -m 0644 data/com.system76.PowerDaemon.xml $out/share/dbus-1/interfaces/com.system76.PowerDaemon.xml
31 description = "System76 Power Management";
32 mainProgram = "system76-power";
33 homepage = "https://github.com/pop-os/system76-power";
34 license = lib.licenses.gpl3Plus;
35 platforms = [ "i686-linux" "x86_64-linux" "aarch64-linux" ];
36 maintainers = with lib.maintainers; [ smonson ahoneybun ];