Skip to content

Instantly share code, notes, and snippets.

@joepie91
Created September 27, 2017 20:59
Show Gist options
  • Save joepie91/bde75e1b7e1f0df6d0a004b67c3e1eae to your computer and use it in GitHub Desktop.
Save joepie91/bde75e1b7e1f0df6d0a004b67c3e1eae to your computer and use it in GitHub Desktop.
{ stdenv, fetchFromGitHub, makeWrapper, ruby, bundlerEnv, defaultGemConfig }:
# Maintainer notes for updating:
# 1. increment version number in expression and in Gemfile
# ... then from the folder this file is in...
# 2. run $ nix-shell --command "bundler install && bundix"
# 3. run $ sed -i '/[ ]*dependencies =/d' gemset.nix
# 4. run $ nix-build -A arachni ../
# 5. update sha256sum in expression
# 6. run step 3 again
let
env = bundlerEnv {
inherit ruby;
name = "arachni-bundler-env";
gemdir = ./.;
gemConfig = defaultGemConfig // {
arachni = attrs: {
# rb-readline-0.5.1 insists on home being a directory
HOME = "/";
};
};
};
in stdenv.mkDerivation rec {
name = "arachni-${version}";
version = "1.5.1";
src = fetchFromGitHub {
owner = "Arachni";
repo = "arachni";
rev = "v${version}";
sha256 = "0y5d1n6hkw85jb3rblcxqas2fp82h3nghssa4xqrhqnz25l799pj";
};
buildInputs = [ makeWrapper ];
#dontPatchelf = true; # stay away from exploit executables
installPhase = ''
mkdir -p $out/{bin,share/arachni}
cp -r * $out/share/arachni/
(
cd $out/share/arachni/bin/
for i in arachni*; do
makeWrapper ${env}/bin/bundle $out/bin/$i \
--add-flags "exec ${ruby}/bin/ruby $out/share/arachni/bin/$i"
done
)
'';
meta = with stdenv.lib; {
description = "Arachni is a feature-full, modular, high-performance Ruby framework aimed towards helping penetration testers and administrators evaluate the security of modern web applications.";
homepage = http://www.arachni-scanner.com/;
platforms = platforms.unix; # FIXME?
license = licenses.nonfree;
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment