From 7760f16f37f378b9cd0891c42c634dd1fa587ef5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tristan=20Dani=C3=ABl=20Maat?= Date: Sun, 17 Aug 2025 23:43:06 +0800 Subject: [PATCH 1/3] refactor(update-script): Switch from nvfetcher to nix-update --- pkgs/crowdsec/_sources/generated.json | 44 --------------------------- pkgs/crowdsec/_sources/generated.nix | 27 ---------------- pkgs/crowdsec/firewall-bouncer.nix | 16 +++++++--- pkgs/crowdsec/hub.nix | 18 ++++++++++- pkgs/crowdsec/nvfetcher.toml | 7 ----- 5 files changed, 29 insertions(+), 83 deletions(-) delete mode 100644 pkgs/crowdsec/_sources/generated.json delete mode 100644 pkgs/crowdsec/_sources/generated.nix delete mode 100644 pkgs/crowdsec/nvfetcher.toml diff --git a/pkgs/crowdsec/_sources/generated.json b/pkgs/crowdsec/_sources/generated.json deleted file mode 100644 index fd61141..0000000 --- a/pkgs/crowdsec/_sources/generated.json +++ /dev/null @@ -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" - } -} \ No newline at end of file diff --git a/pkgs/crowdsec/_sources/generated.nix b/pkgs/crowdsec/_sources/generated.nix deleted file mode 100644 index b5efc4e..0000000 --- a/pkgs/crowdsec/_sources/generated.nix +++ /dev/null @@ -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"; - }; -} diff --git a/pkgs/crowdsec/firewall-bouncer.nix b/pkgs/crowdsec/firewall-bouncer.nix index cfb062a..f3156f9 100644 --- a/pkgs/crowdsec/firewall-bouncer.nix +++ b/pkgs/crowdsec/firewall-bouncer.nix @@ -1,6 +1,6 @@ { lib, - sources, + fetchFromGitHub, buildGoModule, envsubst, coreutils, @@ -8,8 +8,16 @@ let envsubstBin = lib.getExe envsubst; in -buildGoModule { - inherit (sources.crowdsec-firewall-bouncer) pname version src; +buildGoModule (drv: { + 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="; @@ -23,4 +31,4 @@ buildGoModule { substituteInPlace $out/lib/systemd/system/crowdsec-firewall-bouncer.service \ --replace-fail /bin/sleep ${coreutils}/bin/sleep ''; -} +}) diff --git a/pkgs/crowdsec/hub.nix b/pkgs/crowdsec/hub.nix index 1b8c9b3..3bc115b 100644 --- a/pkgs/crowdsec/hub.nix +++ b/pkgs/crowdsec/hub.nix @@ -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 + ''; +}) diff --git a/pkgs/crowdsec/nvfetcher.toml b/pkgs/crowdsec/nvfetcher.toml deleted file mode 100644 index 2287dba..0000000 --- a/pkgs/crowdsec/nvfetcher.toml +++ /dev/null @@ -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" From 3fa21d0581a6ee0b42013e335b01023adaa228b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tristan=20Dani=C3=ABl=20Maat?= Date: Sat, 23 Aug 2025 01:02:22 +0800 Subject: [PATCH 2/3] fix(minecraftmon): Update openpac to prevent crashing --- pkgs/minecraftmon/index.toml | 2 +- pkgs/minecraftmon/mods/open-parties-and-claims.pw.toml | 8 ++++---- pkgs/minecraftmon/pack.toml | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/pkgs/minecraftmon/index.toml b/pkgs/minecraftmon/index.toml index b4da288..9fd6f0c 100644 --- a/pkgs/minecraftmon/index.toml +++ b/pkgs/minecraftmon/index.toml @@ -573,7 +573,7 @@ metafile = true [[files]] file = "mods/open-parties-and-claims.pw.toml" -hash = "db49860c8895c4259982514b2c32f3ce206f8f9dd5ef7e96a40f7f3522673691" +hash = "28d546c3ea37927bd45975200aa74c1e8fb8bd82d2a29e611abe577389818702" metafile = true [[files]] diff --git a/pkgs/minecraftmon/mods/open-parties-and-claims.pw.toml b/pkgs/minecraftmon/mods/open-parties-and-claims.pw.toml index 9500997..cb48558 100644 --- a/pkgs/minecraftmon/mods/open-parties-and-claims.pw.toml +++ b/pkgs/minecraftmon/mods/open-parties-and-claims.pw.toml @@ -1,13 +1,13 @@ name = "Open Parties and Claims" -filename = "open-parties-and-claims-neoforge-1.21.1-0.25.1.jar" +filename = "open-parties-and-claims-neoforge-1.21.1-0.25.4.jar" side = "both" [download] -url = "https://cdn.modrinth.com/data/gF3BGWvG/versions/878uXsIw/open-parties-and-claims-neoforge-1.21.1-0.25.1.jar" +url = "https://cdn.modrinth.com/data/gF3BGWvG/versions/a49p7KOL/open-parties-and-claims-neoforge-1.21.1-0.25.4.jar" hash-format = "sha512" -hash = "d32dde39f2bf65787d01d1654d353de54986310f9dee7b091da63c21870d8a0f6c1275cd96b3c9863e84cc7a9e404419ff16b8e6ff047c18f7cb47c491db220d" +hash = "46ce717e8298366a6616568e5ceadf6ab16a6128d5637143c12786a841dd000aafcb170b67e9f4af6ae71c3cd79a0295645093d0af5c5a47ca129d5dcfaf4310" [update] [update.modrinth] mod-id = "gF3BGWvG" -version = "878uXsIw" +version = "a49p7KOL" diff --git a/pkgs/minecraftmon/pack.toml b/pkgs/minecraftmon/pack.toml index 3752c99..4149443 100644 --- a/pkgs/minecraftmon/pack.toml +++ b/pkgs/minecraftmon/pack.toml @@ -5,7 +5,7 @@ pack-format = "packwiz:1.1.0" [index] file = "index.toml" hash-format = "sha256" -hash = "eff04d9ba259bf1fc333cfe14d4607f4043d0fb878763fea6bbc4a5db09c10ae" +hash = "a35901970241b054b4f6c1bab49f62728506f2be2cdd60ef0c26b2f9db672d6f" [versions] minecraft = "1.21.1" From b1edd5aab692844822db07f47de42ffa41cdc156 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tristan=20Dani=C3=ABl=20Maat?= Date: Sun, 17 Aug 2025 23:43:06 +0800 Subject: [PATCH 3/3] refactor(update-script): Switch from nvfetcher to nix-update --- pkgs/crowdsec/_sources/generated.json | 44 --------------------------- pkgs/crowdsec/_sources/generated.nix | 27 ---------------- pkgs/crowdsec/firewall-bouncer.nix | 16 +++++++--- pkgs/crowdsec/hub.nix | 18 ++++++++++- pkgs/crowdsec/nvfetcher.toml | 7 ----- 5 files changed, 29 insertions(+), 83 deletions(-) delete mode 100644 pkgs/crowdsec/_sources/generated.json delete mode 100644 pkgs/crowdsec/_sources/generated.nix delete mode 100644 pkgs/crowdsec/nvfetcher.toml diff --git a/pkgs/crowdsec/_sources/generated.json b/pkgs/crowdsec/_sources/generated.json deleted file mode 100644 index fd61141..0000000 --- a/pkgs/crowdsec/_sources/generated.json +++ /dev/null @@ -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" - } -} \ No newline at end of file diff --git a/pkgs/crowdsec/_sources/generated.nix b/pkgs/crowdsec/_sources/generated.nix deleted file mode 100644 index b5efc4e..0000000 --- a/pkgs/crowdsec/_sources/generated.nix +++ /dev/null @@ -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"; - }; -} diff --git a/pkgs/crowdsec/firewall-bouncer.nix b/pkgs/crowdsec/firewall-bouncer.nix index cfb062a..f3156f9 100644 --- a/pkgs/crowdsec/firewall-bouncer.nix +++ b/pkgs/crowdsec/firewall-bouncer.nix @@ -1,6 +1,6 @@ { lib, - sources, + fetchFromGitHub, buildGoModule, envsubst, coreutils, @@ -8,8 +8,16 @@ let envsubstBin = lib.getExe envsubst; in -buildGoModule { - inherit (sources.crowdsec-firewall-bouncer) pname version src; +buildGoModule (drv: { + 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="; @@ -23,4 +31,4 @@ buildGoModule { substituteInPlace $out/lib/systemd/system/crowdsec-firewall-bouncer.service \ --replace-fail /bin/sleep ${coreutils}/bin/sleep ''; -} +}) diff --git a/pkgs/crowdsec/hub.nix b/pkgs/crowdsec/hub.nix index 1b8c9b3..3bc115b 100644 --- a/pkgs/crowdsec/hub.nix +++ b/pkgs/crowdsec/hub.nix @@ -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 + ''; +}) diff --git a/pkgs/crowdsec/nvfetcher.toml b/pkgs/crowdsec/nvfetcher.toml deleted file mode 100644 index 2287dba..0000000 --- a/pkgs/crowdsec/nvfetcher.toml +++ /dev/null @@ -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"