vifm: 0.13 -> 0.14 (#380559)
[NixPkgs.git] / pkgs / by-name / sh / shim-unsigned / package.nix
blobc9c2116b0999c678076ad4cc5402b54c856b5b96
2   stdenv,
3   fetchFromGitHub,
4   lib,
5   elfutils,
6   vendorCertFile ? null,
7   defaultLoader ? null,
8 }:
10 let
12   inherit (stdenv.hostPlatform) system;
13   throwSystem = throw "Unsupported system: ${system}";
15   archSuffix =
16     {
17       x86_64-linux = "x64";
18       aarch64-linux = "aa64";
19     }
20     .${system} or throwSystem;
22 stdenv.mkDerivation rec {
23   pname = "shim";
24   version = "15.8";
26   src = fetchFromGitHub {
27     owner = "rhboot";
28     repo = pname;
29     rev = version;
30     hash = "sha256-xnr9HBfYP035C7p2YTRZasx5SF4a2ZkOl9IpsVduNm4=";
31     fetchSubmodules = true;
32   };
34   buildInputs = [ elfutils ];
36   env.NIX_CFLAGS_COMPILE = toString [ "-I${toString elfutils.dev}/include" ];
38   makeFlags =
39     lib.optional (vendorCertFile != null) "VENDOR_CERT_FILE=${vendorCertFile}"
40     ++ lib.optional (defaultLoader != null) "DEFAULT_LOADER=${defaultLoader}";
42   installTargets = [ "install-as-data" ];
43   installFlags = [
44     "DATATARGETDIR=$(out)/share/shim"
45   ];
47   passthru = {
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
51     inherit archSuffix;
52     target = "shim${archSuffix}.efi";
53     mokManagerTarget = "mm${archSuffix}.efi";
54     fallbackTarget = "fb${archSuffix}.efi";
55   };
57   meta = with lib; {
58     description = "UEFI shim loader";
59     homepage = "https://github.com/rhboot/shim";
60     license = licenses.bsd1;
61     platforms = [
62       "x86_64-linux"
63       "aarch64-linux"
64     ];
65     maintainers = with maintainers; [
66       baloo
67       raitobezarius
68     ];
69   };