-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathhax.nix
31 lines (30 loc) · 807 Bytes
/
hax.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# This module provides some hacky `pog` tools!
final: prev:
with prev;
{
mitm2openapi = pog {
name = "mitm2openapi";
description = "convert mitmproxy flows into openapi specs!";
flags = [
{
name = "flows";
description = "the exported flows output from mitmproxy";
default = "./flows";
}
{
name = "spec";
description = "the OpenAPI spec file to use";
default = "./schema.yaml";
}
{
name = "baseurl";
description = "the base url for the api to generate for";
}
];
script = helpers: ''
${pkgs.python311Packages.mitmproxy2swagger}/bin/mitmproxy2swagger -i "$flows" -o "$spec" -p "$baseurl"
${_.yq} -i e 'del(.paths.[].options)' "$spec"
'';
};
hax_pog_scripts = [ ];
}