nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 appimageTools,
4 fetchurl,
5 asar,
6}:
7let
8 pname = "proxyman";
9 version = "3.6.0";
10
11 src = fetchurl {
12 url = "https://github.com/ProxymanApp/proxyman-windows-linux/releases/download/${version}/Proxyman-${version}.AppImage";
13 hash = "sha256-uGzegB/t/9/ovgTY3F2ihBKOgLKDenZh2Ojg9SBNQos=";
14 };
15
16 appimageContents = appimageTools.extract {
17 inherit pname version src;
18 postExtract = ''
19 ${asar}/bin/asar extract $out/resources/app.asar app
20
21 # This will fix the issue with Proxyman not detecting NixOS as a valid Linux environment
22 substituteInPlace app/dist/main/main.js --replace-fail "/etc/ca-certificates/trust-source/anchors/" "/etc/ssl/certs/"
23
24 # This will permanently mark the certificate as installed, as this should be done through Nix config rather than
25 # placing / editing a file in /etc like Proxyman would expect.
26 # Configure the certificate located in "~/.config/Proxyman/certificate/certs/ca.pem" using security.pki.certificates in your nix config
27 substituteInPlace app/dist/main/main.js --replace-fail "return this.isFile(this.getNewCertPath(e))" "return true"
28
29 ${asar}/bin/asar pack app $out/resources/app.asar
30 '';
31 };
32
33in
34appimageTools.wrapAppImage {
35 inherit pname version;
36 src = appimageContents;
37
38 extraInstallCommands = ''
39 install -Dm444 ${appimageContents}/proxyman.desktop -t $out/share/applications
40 install -Dm444 ${appimageContents}/proxyman.png -t $out/share/pixmaps
41 substituteInPlace $out/share/applications/proxyman.desktop \
42 --replace-fail "Exec=AppRun" "Exec=proxyman --"
43 '';
44
45 meta = {
46 description = "Capture, inspect, and manipulate HTTP(s) requests/responses with ease";
47 homepage = "https://proxyman.com";
48 changelog = "https://proxyman.com/changelog-windows";
49 license = lib.licenses.unfree;
50 mainProgram = "proxyman";
51 maintainers = with lib.maintainers; [ nilathedragon ];
52 platforms = [ "x86_64-linux" ];
53 sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ];
54 };
55}