about summary refs log tree commit diff
path: root/pkgs/build-support/mitm-cache/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/build-support/mitm-cache/default.nix')
-rw-r--r--pkgs/build-support/mitm-cache/default.nix44
1 files changed, 44 insertions, 0 deletions
diff --git a/pkgs/build-support/mitm-cache/default.nix b/pkgs/build-support/mitm-cache/default.nix
new file mode 100644
index 0000000000000..dd44a7ddca9af
--- /dev/null
+++ b/pkgs/build-support/mitm-cache/default.nix
@@ -0,0 +1,44 @@
+{ lib
+, stdenv
+, fetchFromGitHub
+, callPackage
+, rustPlatform
+, substituteAll
+, openssl
+, Security
+, python3Packages
+}:
+
+rustPlatform.buildRustPackage rec {
+  pname = "mitm-cache";
+  version = "0.1.1";
+
+  src = fetchFromGitHub {
+    owner = "chayleaf";
+    repo = "mitm-cache";
+    rev = "v${version}";
+    hash = "sha256-l9dnyA4Zo4jlbiCMRzUqW3NkiploVpmvxz9i896JkXU=";
+  };
+
+  buildInputs = lib.optionals stdenv.isDarwin [
+    Security
+  ];
+
+  cargoHash = "sha256-6eYOSSlswJGR2IrFo17qVnwI+h2FkyTjLFvwf62nG2c=";
+
+  setupHook = substituteAll {
+    src = ./setup-hook.sh;
+    inherit openssl;
+    ephemeral_port_reserve = python3Packages.ephemeral-port-reserve;
+  };
+
+  passthru.fetch = callPackage ./fetch.nix { };
+
+  meta = with lib; {
+    description = "A MITM caching proxy for use in nixpkgs";
+    homepage = "https://github.com/chayleaf/mitm-cache#readme";
+    license = licenses.mit;
+    maintainers = with maintainers; [ chayleaf ];
+    mainProgram = "mitm-cache";
+  };
+}