2021-03-14 19:12:53 +01:00
|
|
|
{ rustPlatform, lib, fetchFromGitHub, xz, pkg-config, openssl, dbus, efibootmgr, makeWrapper }:
|
2020-09-23 02:14:14 +02:00
|
|
|
rustPlatform.buildRustPackage rec {
|
|
|
|
pname = "system76-firmware";
|
|
|
|
# Check Makefile when updating, make sure postInstall matches make install
|
2021-03-09 20:41:36 +01:00
|
|
|
version = "1.0.24";
|
2020-09-23 02:14:14 +02:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "pop-os";
|
|
|
|
repo = pname;
|
|
|
|
rev = version;
|
2021-03-09 20:41:36 +01:00
|
|
|
sha256 = "sha256-Poe18HKEQusvN3WF4ZAV1WCvU8/3HKpHEqDsfDO62V0=";
|
2020-09-23 02:14:14 +02:00
|
|
|
};
|
|
|
|
|
2021-01-19 07:50:56 +01:00
|
|
|
nativeBuildInputs = [ pkg-config makeWrapper ];
|
2020-09-23 02:14:14 +02:00
|
|
|
|
2021-03-14 19:12:53 +01:00
|
|
|
buildInputs = [ xz openssl dbus ];
|
2020-09-23 02:14:14 +02:00
|
|
|
|
|
|
|
cargoBuildFlags = [ "--workspace" ];
|
|
|
|
|
2021-05-07 13:00:49 +02:00
|
|
|
cargoSha256 = "sha256-gGw3zpxLxQZ3rglpDERO0fSxBOez1Q10Fljis6nyB/4=";
|
2020-09-23 02:14:14 +02: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-24 19:12:19 +01:00
|
|
|
meta = with lib; {
|
2020-10-11 07:55:05 +02:00
|
|
|
description = "Tools for managing firmware updates for system76 devices";
|
2020-09-23 02:14:14 +02:00
|
|
|
homepage = "https://github.com/pop-os/system76-firmware";
|
2021-03-24 19:12:19 +01:00
|
|
|
license = licenses.gpl3Only;
|
|
|
|
maintainers = with maintainers; [ shlevy ];
|
|
|
|
platforms = [ "i686-linux" "x86_64-linux" ];
|
2020-09-23 02:14:14 +02:00
|
|
|
};
|
|
|
|
}
|