Compare commits

..

2 commits

2 changed files with 42 additions and 4 deletions

View file

@ -4,19 +4,22 @@
buildGoModule, buildGoModule,
envsubst, envsubst,
coreutils, coreutils,
writers,
nix-update,
}: }:
let let
envsubstBin = lib.getExe envsubst; envsubstBin = lib.getExe envsubst;
in in
buildGoModule (drv: { buildGoModule (drv: {
pname = "crowdsec-firewall-bouncer"; pname = "crowdsec-firewall-bouncer";
version = "0.0.34"; version = drv.src.rev;
src = fetchFromGitHub { src = fetchFromGitHub {
owner = "crowdsecurity"; owner = "crowdsecurity";
repo = "cs-firewall-bouncer"; repo = "cs-firewall-bouncer";
rev = drv.version; rev = "0.0.34";
hash = "sha256-lDO9pwPkbI+FDTdXBv03c0p8wbkRUiIDNl1ip3AZo2g="; sha256 = "sha256-lDO9pwPkbI+FDTdXBv03c0p8wbkRUiIDNl1ip3AZo2g=";
}; };
vendorHash = "sha256-SbpclloBgd9vffC0lBduGRqPOqmzQ0J91/KeDHCh0jo="; vendorHash = "sha256-SbpclloBgd9vffC0lBduGRqPOqmzQ0J91/KeDHCh0jo=";
@ -31,4 +34,18 @@ buildGoModule (drv: {
substituteInPlace $out/lib/systemd/system/crowdsec-firewall-bouncer.service \ substituteInPlace $out/lib/systemd/system/crowdsec-firewall-bouncer.service \
--replace-fail /bin/sleep ${coreutils}/bin/sleep --replace-fail /bin/sleep ${coreutils}/bin/sleep
''; '';
passthru.updateScript =
writers.writeNuBin "update-crowdsec-firewall-bouncer"
{
makeWrapperArgs = [
"--prefix"
"PATH"
":"
(lib.makeBinPath [ nix-update ])
];
}
''
nix-update --flake --format crowdsec-firewall-bouncer
'';
}) })

View file

@ -1,4 +1,11 @@
{ fetchFromGitHub, stdenvNoCC }: {
lib,
fetchFromGitHub,
stdenvNoCC,
writers,
nix-update,
}:
# Using `mkDerivation` so nix-update can pick up the version # Using `mkDerivation` so nix-update can pick up the version
stdenvNoCC.mkDerivation (drv: { stdenvNoCC.mkDerivation (drv: {
pname = "crowdsec-hub"; pname = "crowdsec-hub";
@ -14,4 +21,18 @@ stdenvNoCC.mkDerivation (drv: {
installPhase = '' installPhase = ''
cp -r $src $out cp -r $src $out
''; '';
passthru.updateScript =
writers.writeNuBin "update-crowdsec-hub"
{
makeWrapperArgs = [
"--prefix"
"PATH"
":"
(lib.makeBinPath [ nix-update ])
];
}
''
nix-update --flake --format --version=skip crowdsec-hub
'';
}) })