mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-02-06 04:03:04 +00:00
slowlorust: refactor (#361412)
This commit is contained in:
commit
aedc37d8a8
45
pkgs/by-name/sl/slowlorust/package.nix
Normal file
45
pkgs/by-name/sl/slowlorust/package.nix
Normal file
@ -0,0 +1,45 @@
|
||||
{
|
||||
lib,
|
||||
stdenv,
|
||||
darwin,
|
||||
fetchFromGitHub,
|
||||
rustPlatform,
|
||||
versionCheckHook,
|
||||
}:
|
||||
|
||||
rustPlatform.buildRustPackage rec {
|
||||
pname = "slowlorust";
|
||||
version = "0.1.1";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "MJVL";
|
||||
repo = "slowlorust";
|
||||
rev = "refs/tags/${version}";
|
||||
hash = "sha256-c4NWkQ/QvlUo1YoV2s7rWB6wQskAP5Qp1WVM23wvV3c=";
|
||||
};
|
||||
|
||||
cargoHash = "sha256-Wu1mm+yJw2SddddxC5NfnMWLr+dplnRxH3AJ1/mTAKM=";
|
||||
|
||||
postPatch = ''
|
||||
# https://github.com/MJVL/slowlorust/issues/2
|
||||
substituteInPlace src/main.rs \
|
||||
--replace-fail 'version = "1.0"' 'version = "${version}"'
|
||||
'';
|
||||
|
||||
buildInputs = lib.optional stdenv.hostPlatform.isDarwin [ darwin.apple_sdk.frameworks.Security ];
|
||||
|
||||
nativeInstallCheckInputs = [ versionCheckHook ];
|
||||
|
||||
doInstallCheck = true;
|
||||
|
||||
versionCheckProgramArg = [ "--version" ];
|
||||
|
||||
meta = with lib; {
|
||||
description = "Lightweight slowloris (HTTP DoS) tool";
|
||||
homepage = "https://github.com/MJVL/slowlorust";
|
||||
changelog = "https://github.com/MJVL/slowlorust/releases/tag/${version}";
|
||||
license = licenses.mit;
|
||||
maintainers = with maintainers; [ fab ];
|
||||
mainProgram = "slowlorust";
|
||||
};
|
||||
}
|
@ -1,32 +0,0 @@
|
||||
{ lib
|
||||
, stdenv
|
||||
, fetchFromGitHub
|
||||
, rustPlatform
|
||||
, Security
|
||||
}:
|
||||
|
||||
rustPlatform.buildRustPackage rec {
|
||||
pname = "slowlorust";
|
||||
version = "0.1.1";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "MJVL";
|
||||
repo = pname;
|
||||
rev = version;
|
||||
hash = "sha256-c4NWkQ/QvlUo1YoV2s7rWB6wQskAP5Qp1WVM23wvV3c=";
|
||||
};
|
||||
|
||||
cargoHash = "sha256-Wu1mm+yJw2SddddxC5NfnMWLr+dplnRxH3AJ1/mTAKM=";
|
||||
|
||||
buildInputs = lib.optionals stdenv.hostPlatform.isDarwin [
|
||||
Security
|
||||
];
|
||||
|
||||
meta = with lib; {
|
||||
description = "Lightweight slowloris (HTTP DoS) tool";
|
||||
homepage = "https://github.com/MJVL/slowlorust";
|
||||
license = licenses.mit;
|
||||
maintainers = with maintainers; [ fab ];
|
||||
mainProgram = "slowlorust";
|
||||
};
|
||||
}
|
@ -5230,10 +5230,6 @@ with pkgs;
|
||||
ocamlPackages = ocaml-ng.ocamlPackages_4_12;
|
||||
};
|
||||
|
||||
slowlorust = callPackage ../tools/networking/slowlorust {
|
||||
inherit (darwin.apple_sdk.frameworks) Security;
|
||||
};
|
||||
|
||||
slstatus = callPackage ../applications/misc/slstatus {
|
||||
conf = config.slstatus.conf or null;
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user