feat: add nix flake

This commit is contained in:
Hansen
2025-06-12 03:43:51 +03:00
parent bdf9712ef2
commit 588bc033b0
3 changed files with 172 additions and 0 deletions

118
default.nix Normal file
View File

@@ -0,0 +1,118 @@
{
lib,
pkgs,
buildFHSEnv,
fetchurl,
jdk,
makeDesktopItem,
unzip,
}: let
version = "2025.1.1";
productName = "pro";
productDesktop = "BurpSuite Professional";
burpHash = "sha256-17COQ9deYkzmaXBbg1arD3BQY7l3WZ9FakLXzTxgmr8=";
burpSrc = fetchurl {
name = "burpsuite.jar";
urls = [
"https://portswigger-cdn.net/burp/releases/download?product=${productName}&version=${version}&type=Jar"
"https://portswigger.net/burp/releases/download?product=${productName}&version=${version}&type=Jar"
"https://web.archive.org/web/https://portswigger.net/burp/releases/download?product=${productName}&version=${version}&type=Jar"
];
hash = burpHash;
};
loaderSrc = ./.;
pname = "burpsuitepro";
description = "An integrated platform for performing security testing of web applications";
desktopItem = makeDesktopItem {
name = "burpsuitepro";
exec = pname;
icon = pname;
desktopName = productDesktop;
comment = description;
categories = [
"Development"
"Security"
"System"
];
};
in
buildFHSEnv {
inherit pname version;
runScript = "${jdk}/bin/java --add-opens=java.desktop/javax.swing=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/jdk.internal.org.objectweb.asm=ALL-UNNAMED --add-opens=java.base/jdk.internal.org.objectweb.asm.tree=ALL-UNNAMED --add-opens=java.base/jdk.internal.org.objectweb.asm.Opcodes=ALL-UNNAMED -javaagent:${loaderSrc}/loader.jar -noverify -jar ${burpSrc} &";
targetPkgs = pkgs:
with pkgs; [
alsa-lib
at-spi2-core
cairo
cups
dbus
expat
glib
gtk3
gtk3-x11
jython
libcanberra-gtk3
libdrm
udev
libxkbcommon
libgbm
nspr
nss
pango
xorg.libX11
xorg.libxcb
xorg.libXcomposite
xorg.libXdamage
xorg.libXext
xorg.libXfixes
xorg.libXrandr
];
extraInstallCommands = ''
mkdir -p $out/share/pixmaps
mkdir -p $out/share
${lib.getBin unzip}/bin/unzip -p ${burpSrc} resources/Media/icon64${productName}.png > $out/share/pixmaps/burpsuitepro.png
cp ${burpSrc} $out/share/burpsuite_pro_v${version}.jar
cp ${loaderSrc}/loader.jar $out/share/loader.jar
# Create loader executable
mkdir -p $out/bin
echo "#!${pkgs.bash}/bin/bash" > $out/bin/loader
echo "\"${jdk}/bin/java\" -jar \"$out/share/loader.jar\" \"\$@\"" >> $out/bin/loader
chmod +x $out/bin/loader
cp -r ${desktopItem}/share/applications $out/share
'';
meta = with lib; {
inherit description;
longDescription = ''
Burp Suite is an integrated platform for performing security testing of web applications.
Its various tools work seamlessly together to support the entire testing process, from
initial mapping and analysis of an application's attack surface, through to finding and
exploiting security vulnerabilities.
'';
homepage = "https://github.com/sammhansen/Burpsuite-Professional.git";
changelog =
"https://portswigger.net/burp/releases/professional-community-"
+ replaceStrings ["."] ["-"] version;
sourceProvenance = with sourceTypes; [binaryBytecode];
license = licenses.unfree;
platforms = jdk.meta.platforms;
hydraPlatforms = [];
maintainers = with maintainers; [
bennofs
fab
];
mainProgram = "burpsuite";
};
}

27
flake.lock generated Normal file
View File

@@ -0,0 +1,27 @@
{
"nodes": {
"nixpkgs": {
"locked": {
"lastModified": 1749285348,
"narHash": "sha256-frdhQvPbmDYaScPFiCnfdh3B/Vh81Uuoo0w5TkWmmjU=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "3e3afe5174c561dee0df6f2c2b2236990146329f",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"nixpkgs": "nixpkgs"
}
}
},
"root": "root",
"version": 7
}

27
flake.nix Normal file
View File

@@ -0,0 +1,27 @@
{
description = "A nixos flake for burpsuite pro";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable";
};
outputs = {
self,
nixpkgs,
}: let
system = "x86_64-linux";
pkgs = import nixpkgs {
inherit system;
config = {
allowUnfree = true;
};
};
in {
packages.${system} = {
burpsuitepro =
pkgs.callPackage ./default.nix {
};
default = self.packages.${system}.burpsuitepro;
};
};
}