12 inherit (stdenv.hostPlatform) system;
13 throwSystem = throw "Unsupported system: ${system}";
18 aarch64-linux = "aa64";
20 .${system} or throwSystem;
22 stdenv.mkDerivation rec {
26 src = fetchFromGitHub {
30 hash = "sha256-xnr9HBfYP035C7p2YTRZasx5SF4a2ZkOl9IpsVduNm4=";
31 fetchSubmodules = true;
34 buildInputs = [ elfutils ];
36 env.NIX_CFLAGS_COMPILE = toString [ "-I${toString elfutils.dev}/include" ];
39 lib.optional (vendorCertFile != null) "VENDOR_CERT_FILE=${vendorCertFile}"
40 ++ lib.optional (defaultLoader != null) "DEFAULT_LOADER=${defaultLoader}";
42 installTargets = [ "install-as-data" ];
44 "DATATARGETDIR=$(out)/share/shim"
48 # Expose the arch suffix and target file names so that consumers
49 # (e.g. infrastructure for signing this shim) don't need to
50 # duplicate the logic from here
52 target = "shim${archSuffix}.efi";
53 mokManagerTarget = "mm${archSuffix}.efi";
54 fallbackTarget = "fb${archSuffix}.efi";
58 description = "UEFI shim loader";
59 homepage = "https://github.com/rhboot/shim";
60 license = licenses.bsd1;
65 maintainers = with maintainers; [