Commit 6cd7449

HPCesia <me@hpcesia.com>
2026-06-12 04:58:45
refactor: add default version for spritz-wine-bin
1 parent 74e924b
Changed files (4)
pkgs/spritz-wine-bin/cachyos.nix
@@ -1,22 +1,30 @@
 {
   lib,
-  newScope,
+  fetchzip,
   buildHelper,
 }: let
-  versions = lib.importJSON ./version.json;
+  versionData = lib.importJSON ./version.json;
+  versions = versionData.cachyos;
+
+  allVersions =
+    lib.mapAttrs (
+      version: src:
+        buildHelper {
+          name = "spritz-wine-cachyos";
+          inherit version;
+          src = fetchzip src;
+        }
+    )
+    versions;
+
+  latestKey = builtins.head (lib.sort (a: b: builtins.compareVersions a b > 0) (builtins.attrNames versions));
+  latest = allVersions.${latestKey};
+
+  versionedAttrs =
+    lib.mapAttrs' (
+      version: drv:
+        lib.nameValuePair (lib.replaceStrings ["."] ["_"] version) drv
+    )
+    allVersions;
 in
-  lib.makeScope newScope (
-    self:
-      lib.mapAttrs' (
-        version: src:
-          lib.nameValuePair (lib.replaceString "." "_" version) (
-            self.callPackage ({fetchzip}:
-              buildHelper {
-                name = "spritz-wine-cachyos";
-                inherit version;
-                src = fetchzip src;
-              }) {}
-          )
-      )
-      versions.cachyos
-  )
+  latest // versionedAttrs
pkgs/spritz-wine-bin/tkg.nix
@@ -1,22 +1,30 @@
 {
   lib,
-  newScope,
+  fetchzip,
   buildHelper,
 }: let
-  versions = lib.importJSON ./version.json;
+  versionData = lib.importJSON ./version.json;
+  versions = versionData.tkg;
+
+  allVersions =
+    lib.mapAttrs (
+      version: src:
+        buildHelper {
+          name = "spritz-wine-tkg";
+          inherit version;
+          src = fetchzip src;
+        }
+    )
+    versions;
+
+  latestKey = builtins.head (lib.sort (a: b: builtins.compareVersions a b > 0) (builtins.attrNames versions));
+  latest = allVersions.${latestKey};
+
+  versionedAttrs =
+    lib.mapAttrs' (
+      version: drv:
+        lib.nameValuePair (lib.replaceStrings ["."] ["_"] version) drv
+    )
+    allVersions;
 in
-  lib.makeScope newScope (
-    self:
-      lib.mapAttrs' (
-        version: src:
-          lib.nameValuePair (lib.replaceString "." "_" version) (
-            self.callPackage ({fetchzip}:
-              buildHelper {
-                name = "spritz-wine-tkg";
-                inherit version;
-                src = fetchzip src;
-              }) {}
-          )
-      )
-      versions.tkg
-  )
+  latest // versionedAttrs
scripts/gen-readme-config.json
@@ -2,6 +2,9 @@
   "expand_attrs": {
     "helixPlugins": {
       "heading": true
+    },
+    "spritz-wine-bin": {
+      "heading": false
     }
   }
 }
\ No newline at end of file
README.md
@@ -19,7 +19,8 @@
 | `nocturne` | [nocturne](https://github.com/Jeffser/Nocturne) | `1.2.2` | [GPL-3.0-or-later](https://spdx.org/licenses/GPL-3.0-or-later.html) | An Adwaita Music Player / Library Manager  |
 | `particle-music` | [particle-music](https://github.com/AfalpHy/ParticleMusic) | `2.2.1` | [Apache-2.0](https://spdx.org/licenses/Apache-2.0.html) | A cross-platform local music player based on Flutter |
 | `shimmie2` | [shimmie2](https://github.com/shish/shimmie2) | `2.12.2` | [GPL-2.0-or-later](https://spdx.org/licenses/GPL-2.0-or-later.html) | An easy-to-install community image gallery (aka booru) |
-| `spritz-wine-bin` | [spritz-wine-bin](https://github.com/NelloKudo/spritz-wine) | - | [MIT](https://spdx.org/licenses/MIT.html) | Spritz-Wine builds for some games  |
+| `spritz-wine-bin.cachyos` | [spritz-wine-cachyos-bin-10.0-11](https://github.com/NelloKudo/spritz-wine) | `10.0-11` | [MIT](https://spdx.org/licenses/MIT.html) | Spritz-Wine builds for some games  |
+| `spritz-wine-bin.tkg` | [spritz-wine-tkg-bin-11.9-1](https://github.com/NelloKudo/spritz-wine) | `11.9-1` | [MIT](https://spdx.org/licenses/MIT.html) | Spritz-Wine builds for some games  |
 
 ### helixPlugins