nixpkgs/pkgs/by-name/wo/wordlists/package.nix
Janik H. 76cd1d2211 maintainers: drop janik
I guess my time has come as well...

With this commit, I'm not just dropping my maintainer entry, but I'm also
resigning from my duties as a board observer and NixCon project lead.
I also terminated my Summer of Nix contract today.
I'll also stop hosting the local NixOS meetup.

The only "project" I'll finish under the NixOS Foundation umbrella is
Google Summer of Code because the mentees aren't even remotely
responsible for why I'm leaving, and it would be unfair to leave them
hanging.

I'm grateful for all the things I was able to learn, for all the experiences
I could gather, and for all the friends I made along the way.
NixOS is what makes computers bearable for me, so I'll go and work on
some fork (*something something* you always meet twice in life).
2024-07-02 02:36:42 +02:00

74 lines
2.0 KiB
Nix

{ lib
, symlinkJoin
, nmap
, rockyou
, seclists
, wfuzz
, lists ? [
nmap
rockyou
seclists
wfuzz
]
, writeShellScriptBin
, tree
}:
let
wordlistsCollection = symlinkJoin {
name = "wordlists-collection";
paths = lists;
postBuild = ''
shopt -s extglob
rm -rf $out/!(share)
rm -rf $out/share/!(wordlists)
shopt -u extglob
'';
};
# A command to show the location of the links.
wordlistsBin = writeShellScriptBin "wordlists" ''
${lib.getExe tree} ${wordlistsCollection}/share/wordlists
'';
# A command for easy access to the wordlists.
wordlistsPathBin = writeShellScriptBin "wordlists_path" ''
printf "${wordlistsCollection}/share/wordlists\n"
'';
in symlinkJoin {
name = "wordlists";
paths = [
wordlistsCollection
wordlistsBin
wordlistsPathBin
];
meta = with lib; {
description = "Collection of wordlists useful for security testing";
longDescription = ''
The `wordlists` package provides two scripts. One is called {command}`wordlists`,
and it will list a tree of all the wordlists installed. The other one is
called {command}`wordlists_path` which will print the path to the nix store
location of the lists. You can for example do
{command}`$(wordlists_path)/rockyou.txt` to get the location of the
[rockyou](https://en.wikipedia.org/wiki/RockYou#Data_breach)
wordlist. If you want to modify the available wordlists you can override
the `lists` attribute`. In your nixos configuration this would look
similiar to this:
```nix
environment.systemPackages = [
(pkgs.wordlists.override { lists = with pkgs; [ rockyou ] })
]
```
you can use this with nix-shell by doing:
{command}`nix-shell -p 'wordlists.override { lists = with (import <nixpkgs> {}); [ nmap ]; }'
If you want to add a new package that provides wordlist/s the convention
is to copy it to {file}`$out/share/wordlists/myNewWordlist`.
'';
maintainers = with maintainers; [ pamplemousse h7x4 ];
};
}