Skip to content

Commit

Permalink
security-wordlists: Run nixpkgs-fmt
Browse files Browse the repository at this point in the history
Signed-off-by: Pamplemousse <xav.maso@gmail.com>
  • Loading branch information
Pamplemousse committed May 6, 2021
1 parent d5344b3 commit aae7e4d
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 28 deletions.
29 changes: 15 additions & 14 deletions pkgs/tools/security/wordlists/default.nix
Expand Up @@ -6,26 +6,26 @@
}:

let
_wordlistData =
[ { name = "dirbuster"; expressionPath = ./dirbuster.nix; }
{ name = "nmap"; expressionPath = ./nmap.nix; needsPackage = true; }
{ name = "rockyou"; expressionPath = ./rockyou.nix; }
{ name = "seclists"; expressionPath = ./seclists.nix; }
{ name = "wfuzz"; expressionPath = ./wfuzz.nix; needsPackage = true; }
];
_wordlistData = [
{ name = "dirbuster"; expressionPath = ./dirbuster.nix; }
{ name = "nmap"; expressionPath = ./nmap.nix; needsPackage = true; }
{ name = "rockyou"; expressionPath = ./rockyou.nix; }
{ name = "seclists"; expressionPath = ./seclists.nix; }
{ name = "wfuzz"; expressionPath = ./wfuzz.nix; needsPackage = true; }
];

scopedWordlists = lib.makeScope pkgs.newScope (self: with self;
let _packageWithLinkCommandFrom = acc: datum:
# Some wordlists are based on an already existing `nixpkgs` package; Pass it as parameter of the expression.
let parameters = {}
let parameters = { }
// lib.optionalAttrs ((builtins.elem "needsPackage" (builtins.attrNames datum)) && datum.needsPackage) { ${datum.name} = pkgs.${datum.name}; };
in
let p = callPackage datum.expressionPath parameters;
in acc // { ${datum.name} = p; };
in builtins.foldl' _packageWithLinkCommandFrom {} _wordlistData
let p = callPackage datum.expressionPath parameters;
in acc // { ${datum.name} = p; };
in builtins.foldl' _packageWithLinkCommandFrom { } _wordlistData
);

in let
in
let
packageConstructor = wordlistPackages:
symlinkJoin rec {
pname = "security-wordlists";
Expand Down Expand Up @@ -62,7 +62,8 @@ in let
maintainers = with maintainers; [ pamplemousse ];
};
};
in {
in
{
pkgs = scopedWordlists;
withLists = f: packageConstructor (f scopedWordlists);
}
3 changes: 2 additions & 1 deletion pkgs/tools/security/wordlists/dirbuster.nix
Expand Up @@ -5,7 +5,8 @@
let
version = "1.0-RC1";

in fetchzip rec {
in
fetchzip rec {
name = "DirBuster-${version}";

url = "mirror://sourceforge/dirbuster/DirBuster%20%28jar%20%2B%20lists%29/${version}/${name}.zip";
Expand Down
13 changes: 7 additions & 6 deletions pkgs/tools/security/wordlists/nmap.nix
Expand Up @@ -8,12 +8,13 @@ stdenv.mkDerivation {
pname = "nmap";
version = "unstable-2020-10-19";

src = fetchFromGitHub {
owner = "nmap";
repo = "nmap";
rev = "0b49f7f933577a1904f232bfc2d347553ed22860";
sha256 = "sha256-rA6cd9K2uX8EfByTJ2u2/48U4SqD9IGs+3CLlfgxHE0=";
} + "/nselib/data/passwords.lst";
src = fetchFromGitHub
{
owner = "nmap";
repo = "nmap";
rev = "0b49f7f933577a1904f232bfc2d347553ed22860";
sha256 = "sha256-rA6cd9K2uX8EfByTJ2u2/48U4SqD9IGs+3CLlfgxHE0=";
} + "/nselib/data/passwords.lst";

dontUnpack = true;

Expand Down
15 changes: 8 additions & 7 deletions pkgs/tools/security/wordlists/rockyou.nix
Expand Up @@ -7,13 +7,14 @@ stdenv.mkDerivation rec {
pname = "rockyou";
version = "0.3-1kali3";

src = fetchFromGitLab {
group = "kalilinux";
owner = "packages";
repo = "wordlists";
rev = "debian/${version}";
sha256 = "sha256-viOd8iKLTiHrPF0azICp/F16JrPUfo4kbcGUPD2/cRs=";
} + "/rockyou.txt.gz";
src = fetchFromGitLab
{
group = "kalilinux";
owner = "packages";
repo = "wordlists";
rev = "debian/${version}";
sha256 = "sha256-viOd8iKLTiHrPF0azICp/F16JrPUfo4kbcGUPD2/cRs=";
} + "/rockyou.txt.gz";

unpackCmd = ''
mkdir src
Expand Down

0 comments on commit aae7e4d

Please sign in to comment.