2021-04-05 15:23:46 +00:00
|
|
|
{ rustPlatform, lib, fetchFromGitHub, xz, pkg-config, openssl, dbus, efibootmgr, makeWrapper }:
|
2020-09-25 04:45:31 +00:00
|
|
|
rustPlatform.buildRustPackage rec {
|
|
|
|
pname = "system76-firmware";
|
|
|
|
# Check Makefile when updating, make sure postInstall matches make install
|
2022-10-06 18:32:54 +00:00
|
|
|
version = "1.0.43";
|
2020-09-25 04:45:31 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "pop-os";
|
|
|
|
repo = pname;
|
|
|
|
rev = version;
|
2022-10-06 18:32:54 +00:00
|
|
|
sha256 = "sha256-0NlM5ugpJzwzXgm8TqM6/aj3b+lDYbLeYOHNHM3g8aw=";
|
2020-09-25 04:45:31 +00:00
|
|
|
};
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
nativeBuildInputs = [ pkg-config makeWrapper ];
|
2020-09-25 04:45:31 +00:00
|
|
|
|
2021-04-05 15:23:46 +00:00
|
|
|
buildInputs = [ xz openssl dbus ];
|
2020-09-25 04:45:31 +00:00
|
|
|
|
|
|
|
cargoBuildFlags = [ "--workspace" ];
|
|
|
|
|
2022-10-06 18:32:54 +00:00
|
|
|
cargoSha256 = "sha256-oyHnEWtQ0pl4SaJsnao+oTDBuu9PJdU3uqLTDowRWQw=";
|
2020-09-25 04:45:31 +00:00
|
|
|
|
|
|
|
# Purposefully don't install systemd unit file, that's for NixOS
|
|
|
|
postInstall = ''
|
|
|
|
install -D -m -0644 data/system76-firmware-daemon.conf $out/etc/dbus-1/system.d/system76-firmware-daemon.conf
|
|
|
|
|
|
|
|
for bin in $out/bin/system76-firmware-*
|
|
|
|
do
|
|
|
|
wrapProgram $bin --prefix PATH : "${efibootmgr}/bin"
|
|
|
|
done
|
|
|
|
'';
|
|
|
|
|
2021-03-20 04:20:00 +00:00
|
|
|
meta = with lib; {
|
2020-10-19 00:13:06 +00:00
|
|
|
description = "Tools for managing firmware updates for system76 devices";
|
2020-09-25 04:45:31 +00:00
|
|
|
homepage = "https://github.com/pop-os/system76-firmware";
|
2021-03-20 04:20:00 +00:00
|
|
|
license = licenses.gpl3Only;
|
|
|
|
maintainers = with maintainers; [ shlevy ];
|
|
|
|
platforms = [ "i686-linux" "x86_64-linux" ];
|
2020-09-25 04:45:31 +00:00
|
|
|
};
|
|
|
|
}
|