refactor(update-script): Switch from nvfetcher to nix-update

This commit is contained in:
Tristan Daniël Maat 2025-08-17 23:43:06 +08:00
parent 3fa21d0581
commit b1edd5aab6
Signed by: tlater
GPG key ID: 49670FD774E43268
5 changed files with 29 additions and 83 deletions

View file

@ -1,44 +0,0 @@
{
"crowdsec-firewall-bouncer": {
"cargoLocks": null,
"date": null,
"extract": null,
"name": "crowdsec-firewall-bouncer",
"passthru": null,
"pinned": false,
"src": {
"deepClone": false,
"fetchSubmodules": false,
"leaveDotGit": false,
"name": null,
"owner": "crowdsecurity",
"repo": "cs-firewall-bouncer",
"rev": "v0.0.34",
"sha256": "sha256-lDO9pwPkbI+FDTdXBv03c0p8wbkRUiIDNl1ip3AZo2g=",
"sparseCheckout": [],
"type": "github"
},
"version": "v0.0.34"
},
"crowdsec-hub": {
"cargoLocks": null,
"date": "2025-08-17",
"extract": null,
"name": "crowdsec-hub",
"passthru": null,
"pinned": false,
"src": {
"deepClone": false,
"fetchSubmodules": false,
"leaveDotGit": false,
"name": null,
"owner": "crowdsecurity",
"repo": "hub",
"rev": "fc59f78180f3edfce76df3e77b001c454f567d3d",
"sha256": "sha256-Ejx3ta05SMvV/Dj7wy2iF9QYbGoRvxPB3+QuCIoTX4Q=",
"sparseCheckout": [],
"type": "github"
},
"version": "fc59f78180f3edfce76df3e77b001c454f567d3d"
}
}

View file

@ -1,27 +0,0 @@
# This file was generated by nvfetcher, please do not modify it manually.
{ fetchgit, fetchurl, fetchFromGitHub, dockerTools }:
{
crowdsec-firewall-bouncer = {
pname = "crowdsec-firewall-bouncer";
version = "v0.0.34";
src = fetchFromGitHub {
owner = "crowdsecurity";
repo = "cs-firewall-bouncer";
rev = "v0.0.34";
fetchSubmodules = false;
sha256 = "sha256-lDO9pwPkbI+FDTdXBv03c0p8wbkRUiIDNl1ip3AZo2g=";
};
};
crowdsec-hub = {
pname = "crowdsec-hub";
version = "fc59f78180f3edfce76df3e77b001c454f567d3d";
src = fetchFromGitHub {
owner = "crowdsecurity";
repo = "hub";
rev = "fc59f78180f3edfce76df3e77b001c454f567d3d";
fetchSubmodules = false;
sha256 = "sha256-Ejx3ta05SMvV/Dj7wy2iF9QYbGoRvxPB3+QuCIoTX4Q=";
};
date = "2025-08-17";
};
}

View file

@ -1,6 +1,6 @@
{ {
lib, lib,
sources, fetchFromGitHub,
buildGoModule, buildGoModule,
envsubst, envsubst,
coreutils, coreutils,
@ -8,8 +8,16 @@
let let
envsubstBin = lib.getExe envsubst; envsubstBin = lib.getExe envsubst;
in in
buildGoModule { buildGoModule (drv: {
inherit (sources.crowdsec-firewall-bouncer) pname version src; pname = "crowdsec-firewall-bouncer";
version = "0.0.34";
src = fetchFromGitHub {
owner = "crowdsecurity";
repo = "cs-firewall-bouncer";
rev = drv.version;
hash = "sha256-lDO9pwPkbI+FDTdXBv03c0p8wbkRUiIDNl1ip3AZo2g=";
};
vendorHash = "sha256-SbpclloBgd9vffC0lBduGRqPOqmzQ0J91/KeDHCh0jo="; vendorHash = "sha256-SbpclloBgd9vffC0lBduGRqPOqmzQ0J91/KeDHCh0jo=";
@ -23,4 +31,4 @@ buildGoModule {
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
''; '';
} })

View file

@ -1 +1,17 @@
{ sources }: sources.crowdsec-hub.src { fetchFromGitHub, stdenvNoCC }:
# Using `mkDerivation` so nix-update can pick up the version
stdenvNoCC.mkDerivation (drv: {
pname = "crowdsec-hub";
version = drv.src.rev;
src = fetchFromGitHub {
owner = "crowdsecurity";
repo = "hub";
rev = "fc59f78180f3edfce76df3e77b001c454f567d3d";
hash = "sha256-Ejx3ta05SMvV/Dj7wy2iF9QYbGoRvxPB3+QuCIoTX4Q=";
};
installPhase = ''
cp -r $src $out
'';
})

View file

@ -1,7 +0,0 @@
[crowdsec-hub]
src.git = "https://github.com/crowdsecurity/hub.git"
fetch.github = "crowdsecurity/hub"
[crowdsec-firewall-bouncer]
src.github = "crowdsecurity/cs-firewall-bouncer"
fetch.github = "crowdsecurity/cs-firewall-bouncer"