crowdsec: refactor
- add tornax to maintainer list - add notification binaries - remove provided systemd-service file of upstream crowdsec
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
buildGoModule,
|
||||
fetchFromGitHub,
|
||||
installShellFiles,
|
||||
makeBinaryWrapper,
|
||||
}:
|
||||
|
||||
buildGoModule (finalAttrs: {
|
||||
@@ -18,11 +19,21 @@ buildGoModule (finalAttrs: {
|
||||
|
||||
vendorHash = "sha256-RDkttsV4PNOfjWPr4v+uIwdkmXYH83vkYFQQIO3CYGE=";
|
||||
|
||||
nativeBuildInputs = [ installShellFiles ];
|
||||
nativeBuildInputs = [
|
||||
installShellFiles
|
||||
makeBinaryWrapper
|
||||
];
|
||||
|
||||
subPackages = [
|
||||
"cmd/crowdsec"
|
||||
"cmd/crowdsec-cli"
|
||||
"cmd/notification-dummy"
|
||||
"cmd/notification-email"
|
||||
"cmd/notification-file"
|
||||
"cmd/notification-http"
|
||||
"cmd/notification-sentinel"
|
||||
"cmd/notification-slack"
|
||||
"cmd/notification-splunk"
|
||||
];
|
||||
|
||||
ldflags = [
|
||||
@@ -39,13 +50,12 @@ buildGoModule (finalAttrs: {
|
||||
postBuild = "mv $GOPATH/bin/{crowdsec-cli,cscli}";
|
||||
|
||||
postInstall = ''
|
||||
# so that `bin/crowdsec` is available for `cscli explain` for example
|
||||
wrapProgram $out/bin/cscli --prefix PATH : $out/bin/
|
||||
|
||||
mkdir -p $out/share/crowdsec
|
||||
cp -r ./config $out/share/crowdsec/
|
||||
|
||||
mkdir -p $out/lib/systemd/system
|
||||
substitute ./config/crowdsec.service $out/lib/systemd/system/crowdsec.service \
|
||||
--replace-fail /usr/local $out
|
||||
|
||||
installShellCompletion --cmd cscli \
|
||||
--bash <($out/bin/cscli completion bash) \
|
||||
--fish <($out/bin/cscli completion fish) \
|
||||
@@ -63,6 +73,7 @@ buildGoModule (finalAttrs: {
|
||||
'';
|
||||
|
||||
meta = {
|
||||
mainProgram = "crowdsec";
|
||||
homepage = "https://crowdsec.net/";
|
||||
changelog = "https://github.com/crowdsecurity/crowdsec/releases/tag/v${finalAttrs.version}";
|
||||
description = "Free, open-source and collaborative IPS";
|
||||
@@ -80,6 +91,7 @@ buildGoModule (finalAttrs: {
|
||||
license = lib.licenses.mit;
|
||||
maintainers = with lib.maintainers; [
|
||||
jk
|
||||
tornax
|
||||
];
|
||||
};
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user