84 lines
2.7 KiB
Nix
84 lines
2.7 KiB
Nix
{
|
|
pkgs,
|
|
lib,
|
|
...
|
|
}: let
|
|
# shared/global properties
|
|
angryoxide-owner = "Ragnt";
|
|
angryoxide-pname = "AngryOxide";
|
|
angryoxide-version = "0.8.32";
|
|
angryoxide-meta = {
|
|
homepage = "https://github.com/${angryoxide-owner}/${angryoxide-pname}";
|
|
license = lib.licenses.gpl3;
|
|
maintainers = [lib.maintainers.emileclarkb];
|
|
};
|
|
|
|
# "Vendored LibWifi used in AngryOxide"
|
|
angryoxide-libwifi-src = pkgs.fetchFromGitHub {
|
|
owner = angryoxide-owner;
|
|
repo = "libwifi";
|
|
# this specific revision is requested (by rev "e1352..." of AngryOxide)
|
|
rev = "71268e1898ad88b8b5d709e186836db417b33e81";
|
|
sha256 = "0af9y7bvr3rban6bslsd9smrvibfp1b7d4nfw7wkdxfp49kx6zyr";
|
|
};
|
|
|
|
# Using `mkDerivation` not `buildRustPackage` because
|
|
# AngryOxide uses Git submodules for a patched version of "LibWifi",
|
|
# and these aren't moved into `/build/source/libs/` for the `buildPhase`.
|
|
# Simply fix right? Well no I can't override `buildPhase`...
|
|
angryoxide-src = pkgs.stdenv.mkDerivation rec {
|
|
pname = "${angryoxide-pname}-source";
|
|
version = angryoxide-version;
|
|
|
|
src = pkgs.fetchFromGitHub {
|
|
owner = "Ragnt";
|
|
repo = pname;
|
|
rev = "e1352c8aad370efa8db69d175686e4353c6002bd";
|
|
sha256 = "07nhvy7kp7z4y0fdslv56pw7kz6idcpma42f4hyilrmazjbbjmja";
|
|
# clone git submodules (needed for the rust workspace libs)
|
|
fetchSubmodules = true;
|
|
};
|
|
|
|
buildPhase = ''
|
|
# ensure $out and /libwifi paths exist
|
|
mkdir -p $out/libs/libwifi
|
|
# copy only the necessary source files
|
|
cp Cargo.toml Cargo.lock $out/
|
|
cp -r $src/.cargo $src/assets $src/completions $src/libs $src/src $out/
|
|
# ensure libwifi submodule is copied to the build environment
|
|
cp -r ${angryoxide-libwifi-src}/. $out/libs/libwifi/
|
|
'';
|
|
|
|
installPhase = let
|
|
# SOURCE
|
|
completionScriptBash = "completions/bash_angry_oxide_completions";
|
|
# DESTINATION
|
|
completionDirBash = "$out/share/bash-completion/completions";
|
|
in ''
|
|
# mkdir -p $out/bin
|
|
#mkdir $out/bin
|
|
#cp target/release/angryoxide $out/bin
|
|
|
|
# add bash completions
|
|
#mkdir -p ${completionDirBash}
|
|
#cp ${completionScriptBash} ${completionDirBash}/angryoxide
|
|
'';
|
|
|
|
meta =
|
|
{
|
|
description = "AngryOxide's source files isolated by (@emileclarkb) into a separate Nix derivation.";
|
|
}
|
|
// angryoxide-meta;
|
|
};
|
|
in
|
|
pkgs.rustPackages.rustPlatform.buildRustPackage {
|
|
pname = angryoxide-pname;
|
|
version = angryoxide-version;
|
|
src = angryoxide-src;
|
|
cargoHash = "sha256-mry4l0a7DZOWkrChU40OVRCBjKwI39cyZtvEBA5tro0=";
|
|
meta =
|
|
{
|
|
description = "802.11 Attack Tool";
|
|
}
|
|
// angryoxide-meta;
|
|
}
|