Commit f5c61c1

HPCesia <me@hpcesia.com>
2026-05-01 16:52:20
new packages: localbooru-bin
1 parent 10e9add
Changed files (3)
pkgs/localbooru-bin/default.nix
@@ -0,0 +1,59 @@
+# Modify from https://github.com/ixhbinphoenix/nur-packages/blob/3ffe840c9c51685c355265be754a50a9c048e60d/pkgs/localbooru-bin/default.nix
+{
+  lib,
+  fetchurl,
+  stdenv,
+  autoPatchelfHook,
+  dpkg,
+  makeWrapper,
+  wrapGAppsHook3,
+  mpv-unwrapped,
+  xdg-user-dirs,
+  zenity,
+}:
+stdenv.mkDerivation rec {
+  pname = "localbooru-bin";
+  version = "1.6.1";
+
+  src = fetchurl {
+    url = "https://github.com/resucutie/localbooru/releases/download/${version}/localbooru-linux.deb";
+    hash = "sha256-N37XdomSJFu3UPYcTmtihFwwGnbb5JCSdRDMVdlsP+8=";
+  };
+
+  nativeBuildInputs = [
+    autoPatchelfHook
+    dpkg
+    makeWrapper
+    wrapGAppsHook3
+  ];
+
+  buildInputs = [
+    mpv-unwrapped
+    xdg-user-dirs
+    zenity
+  ];
+
+  dontWrapGApps = true;
+
+  installPhase = ''
+    runHook preInstall
+    mkdir -p $out
+    cp -r * $out
+    runHook postInstall
+  '';
+
+  postFixup = ''
+    makeWrapper $out/usr/share/localbooru/localbooru $out/bin/localbooru \
+      "''${gappsWrapperArgs[@]}" \
+      --prefix LD_LIBRARY_PATH : $out/usr/share/localbooru/lib:${lib.makeLibraryPath [mpv-unwrapped]} \
+  '';
+
+  meta = {
+    description = "Cross platform local booru collection that exclusively works on local storage, without selfhosting";
+    homepage = "https://github.com/resucutie/localbooru";
+    mainProgram = "localbooru";
+    platforms = ["x86_64-linux"];
+    license = lib.licenses.gpl3Plus;
+    sourceProvenance = with lib.sourceTypes; [binaryNativeCode];
+  };
+}
default.nix
@@ -19,6 +19,7 @@
   dwproton-bin = pkgs.callPackage ./pkgs/dwproton-bin {};
   harmonoid = pkgs.callPackage ./pkgs/harmonoid {};
   helixPlugins = pkgs.callPackage ./pkgs/helix-plugins {};
+  localbooru-bin = pkgs.callPackage ./pkgs/localbooru-bin {};
   musly-player = pkgs.callPackage ./pkgs/musly-player {};
   particle-music = pkgs.callPackage ./pkgs/particle-music {};
 }
README.md
@@ -10,6 +10,7 @@
 | ---------------- | -------------------------------- | ----------- | --------------- |
 | `dwproton-bin`   | [dwproton-bin][dwproton]         | `10.0-26`   | BSD-3-Clause    |
 | `harmonoid`      | [harmonoid][harmonoid]           | `0.3.22`    | **Unfree**      |
+| `localbooru-bin` | [localbooru-bin][localbooru]     | `1.6.1`     | GPL-3.0         |
 | `musly-player`   | [musly-player][musly]            | `1.0.8`     | CC-BY-NC-SA 4.0 |
 | `particle-music` | [particle-music][particle-music] | `2.1.2`     | Apache-2.0      |
 
@@ -26,5 +27,6 @@
 [helixPlugins/helix-file-watcher]: https://github.com/mattwparas/helix-file-watcher
 [helixPlugins/scooter.hx]: https://github.com/thomasschafer/scooter.hx
 [helixPlugins/wakatime.hx]: https://github.com/Xerxes-2/wakatime.hx
+[localbooru]: https://github.com/resucutie/localbooru
 [musly]: https://github.com/dddevid/Musly
 [particle-music]: https://github.com/AfalpHy/ParticleMusic