Something went wrong. Try again.
What happens if I push all of nixpkgs
Something went wrong. Try again.
4.7 kB · 200 lines
Nix
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201{ lib, stdenv, fetchgit, pkg-config, zlib, pciutils, openssl, coreutils, acpica-tools, makeWrapper, gnugrep, gnused, file, buildEnv,}:
let version = "25.06";
commonMeta = { description = "Various coreboot-related tools"; homepage = "https://www.coreboot.org"; license = with lib.licenses; [ gpl2Only gpl2Plus ]; maintainers = with lib.maintainers; [ felixsinger jmbaur ]; platforms = lib.platforms.linux; };
generic = { pname, path ? "util/${pname}", ... }@args: stdenv.mkDerivation ( finalAttrs: { inherit pname version;
src = fetchgit { url = "https://review.coreboot.org/coreboot"; rev = finalAttrs.version; hash = "sha256-D7W8LtL6eeaKiRYoxVkcjeZ2aMIEXCvNakVtexe0mG8="; };
enableParallelBuilding = true;
postPatch = '' substituteInPlace 3rdparty/vboot/Makefile --replace 'ar qc ' '$$AR qc ' cd ${path} patchShebangs . '';
makeFlags = [ "INSTALL=install" "PREFIX=${placeholder "out"}" ];
meta = commonMeta // args.meta; } // (removeAttrs args [ "meta" ]) );
utils = { msrtool = generic { pname = "msrtool"; meta.description = "Dump chipset-specific MSR registers"; meta.platforms = [ "x86_64-linux" "i686-linux" ]; buildInputs = [ pciutils zlib ]; preConfigure = "export INSTALL=install"; }; cbmem = generic { pname = "cbmem"; meta.description = "Coreboot console log reader"; }; ifdtool = generic { pname = "ifdtool"; meta.description = "Extract and dump Intel Firmware Descriptor information"; }; intelmetool = generic { pname = "intelmetool"; meta.description = "Dump interesting things about Management Engine"; meta.platforms = [ "x86_64-linux" "i686-linux" ]; buildInputs = [ pciutils zlib ]; }; cbfstool = generic { pname = "cbfstool"; meta.description = "Management utility for CBFS formatted ROM images"; }; nvramtool = generic { pname = "nvramtool"; meta.description = "Read and write coreboot parameters and display information from the coreboot table in CMOS/NVRAM"; meta.mainProgram = "nvramtool"; }; superiotool = generic { pname = "superiotool"; meta.description = "User-space utility to detect Super I/O of a mainboard and provide detailed information about the register contents of the Super I/O"; meta.platforms = [ "x86_64-linux" "i686-linux" ]; buildInputs = [ pciutils zlib ]; }; ectool = generic { pname = "ectool"; meta.description = "Dump the RAM of a laptop's Embedded/Environmental Controller (EC)"; meta.platforms = [ "x86_64-linux" "i686-linux" ]; preInstall = "mkdir -p $out/sbin"; }; inteltool = generic { pname = "inteltool"; meta.description = "Provides information about Intel CPU/chipset hardware configuration (register contents, MSRs, etc)"; meta.platforms = [ "x86_64-linux" "i686-linux" ]; buildInputs = [ pciutils zlib ]; }; amdfwtool = generic { pname = "amdfwtool"; meta.description = "Create AMD firmware combination"; buildInputs = [ openssl ]; nativeBuildInputs = [ pkg-config ]; installPhase = '' runHook preInstall
install -Dm755 amdfwtool $out/bin/amdfwtool
runHook postInstall ''; }; acpidump-all = generic { pname = "acpidump-all"; path = "util/acpi"; meta.description = "Walk through all ACPI tables with their addresses"; nativeBuildInputs = [ makeWrapper ]; dontBuild = true; installPhase = '' runHook preInstall
install -Dm755 acpidump-all $out/bin/acpidump-all
runHook postInstall ''; postFixup = '' wrapProgram $out/bin/acpidump-all \ --set PATH ${ lib.makeBinPath [ coreutils acpica-tools gnugrep gnused file ] } ''; }; };
inutils// { coreboot-utils = (buildEnv { name = "coreboot-utils-${version}"; paths = lib.filter (lib.meta.availableOn stdenv.hostPlatform) (lib.attrValues utils); postBuild = "rm -rf $out/sbin"; }) // { inherit version; meta = commonMeta; };}