2020-09-23 00:14:14 +00:00
|
|
|
{ rustPlatform, lib, fetchFromGitHub, lzma, pkgconfig, openssl, dbus, efibootmgr, makeWrapper }:
|
|
|
|
rustPlatform.buildRustPackage rec {
|
|
|
|
pname = "system76-firmware";
|
|
|
|
# Check Makefile when updating, make sure postInstall matches make install
|
2020-09-28 17:10:46 +00:00
|
|
|
version = "1.0.18";
|
2020-09-23 00:14:14 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "pop-os";
|
|
|
|
repo = pname;
|
|
|
|
rev = version;
|
2020-09-28 17:10:46 +00:00
|
|
|
sha256 = "08y65ak3y08xcl1nprwraqv9l65yqnfllbgmxyd2bppjpprwq474";
|
2020-09-23 00:14:14 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [ pkgconfig makeWrapper ];
|
|
|
|
|
|
|
|
buildInputs = [ lzma openssl dbus ];
|
|
|
|
|
|
|
|
cargoBuildFlags = [ "--workspace" ];
|
|
|
|
|
2020-09-28 17:10:46 +00:00
|
|
|
cargoSha256 = "00933zkhqd1l29ir2dgp5r1k7g24mlb2k8fmggwzplrwzw1al5h4";
|
2020-09-23 00:14:14 +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
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = {
|
2020-10-11 05:55:05 +00:00
|
|
|
description = "Tools for managing firmware updates for system76 devices";
|
2020-09-23 00:14:14 +00:00
|
|
|
homepage = "https://github.com/pop-os/system76-firmware";
|
|
|
|
license = lib.licenses.gpl3;
|
|
|
|
maintainers = [ lib.maintainers.shlevy ];
|
|
|
|
platforms = lib.platforms.linux;
|
|
|
|
};
|
|
|
|
}
|