feat: Add crowdsec module
This commit is contained in:
parent
22981fdcdd
commit
d0c6f2bcbe
13 changed files with 624 additions and 6 deletions
pkgs/crowdsec
26
pkgs/crowdsec/firewall-bouncer.nix
Normal file
26
pkgs/crowdsec/firewall-bouncer.nix
Normal file
|
@ -0,0 +1,26 @@
|
|||
{
|
||||
lib,
|
||||
sources,
|
||||
buildGoModule,
|
||||
envsubst,
|
||||
coreutils,
|
||||
}:
|
||||
let
|
||||
envsubstBin = lib.getExe envsubst;
|
||||
in
|
||||
buildGoModule {
|
||||
inherit (sources.crowdsec-firewall-bouncer) pname version src;
|
||||
|
||||
vendorHash = "sha256-7Jxvg8UEjUxnIz1llvXyI2AefJ31OVdNzhWD/C8wU/Y=";
|
||||
|
||||
postInstall = ''
|
||||
mkdir -p $out/lib/systemd/system
|
||||
|
||||
CFG=/var/lib/crowdsec/config BIN=$out/bin/cs-firewall-bouncer ${envsubstBin} \
|
||||
-i ./config/crowdsec-firewall-bouncer.service \
|
||||
-o $out/lib/systemd/system/crowdsec-firewall-bouncer.service
|
||||
|
||||
substituteInPlace $out/lib/systemd/system/crowdsec-firewall-bouncer.service \
|
||||
--replace-fail /bin/sleep ${coreutils}/bin/sleep
|
||||
'';
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue