From 1b9d35c10d5ba08291cdba4a1160dbf227d7db62 Mon Sep 17 00:00:00 2001 From: Adam Joseph Date: Thu, 30 Mar 2023 01:03:48 -0700 Subject: [PATCH] flashrom: append -chromebook to pname and $out/bin-name when forChromebook==true --- src/util/flashrom/default.nix | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/util/flashrom/default.nix b/src/util/flashrom/default.nix index 9909593..9e44ec8 100644 --- a/src/util/flashrom/default.nix +++ b/src/util/flashrom/default.nix @@ -10,12 +10,13 @@ # use google's out-of-tree flashrom which can manipulate the # write-protection registers of the chromebooks' on-board flash -# chips +# chips and can also write to the embedded controller (EC) flash, +# which is a separate chip , forChromebook ? false }: stdenv.mkDerivation { - pname = "flashrom"; + pname = "flashrom${lib.optionalString forChromebook "-chromebook"}"; version = if !forChromebook then "1.2+wp" else "0.9.9+d2da98-google"; src = @@ -46,9 +47,13 @@ stdenv.mkDerivation { makeFlags = if !forChromebook then [ "PREFIX=$(out)" "libinstall" ] else [ - "PREFIX=$(out)" "install" + "PREFIX=$(out)" ]; + postInstall = lib.optionalString forChromebook '' + mv $out/sbin/flashrom $out/sbin/flashrom-chromebook + ''; + meta = with lib; { homepage = "https://www.flashrom.org"; description = "Utility for reading, writing, erasing and verifying flash ROM chips";