From da774695902019c587330182c548bfffff4f8368 Mon Sep 17 00:00:00 2001 From: Matt Nish-Lapidus Date: Mon, 16 Jun 2025 13:35:59 -0400 Subject: [PATCH] adding zotero beta package, niri flake config updates, ... --- flake.lock | 72 +++++++++--------- modules/home/desktop.nix | 1 + modules/home/niri.nix | 14 ++-- modules/home/yazi.nix | 2 +- modules/home/yazi/init.lua | 8 +- overlays/zotero.nix | 10 --- packages/zotero-latest.nix | 149 +++++++++++++++++++++++++++++++++++++ 7 files changed, 195 insertions(+), 61 deletions(-) delete mode 100644 overlays/zotero.nix create mode 100644 packages/zotero-latest.nix diff --git a/flake.lock b/flake.lock index f61880e..59fa9d3 100644 --- a/flake.lock +++ b/flake.lock @@ -30,11 +30,11 @@ ] }, "locked": { - "lastModified": 1749436314, - "narHash": "sha256-CqmqU5FRg5AadtIkxwu8ulDSOSoIisUMZRLlcED3Q5w=", + "lastModified": 1750040002, + "narHash": "sha256-KrC9iOVYIn6ukpVlHbqSA4hYCZ6oDyJKrcLqv4c5v84=", "owner": "nix-community", "repo": "disko", - "rev": "dfa4d1b9c39c0342ef133795127a3af14598017a", + "rev": "7f1857b31522062a6a00f88cbccf86b43acceed1", "type": "github" }, "original": { @@ -90,11 +90,11 @@ "nixpkgs-stable": "nixpkgs-stable" }, "locked": { - "lastModified": 1750007756, - "narHash": "sha256-ubcXh/a2YWJlsnW2XomABgRzBuIRigz3YwHzB5WBTfM=", + "lastModified": 1750091223, + "narHash": "sha256-nxGmxYBRnB3TFUjo4L8wxdOB39LIHwE7C+DRMqe3hxs=", "owner": "nix-community", "repo": "emacs-overlay", - "rev": "c545e874be1fa5453ad4f365e90e9b3dcf6f81ee", + "rev": "d71d520eb14ab918ad054d24139a609f9bb35c1b", "type": "github" }, "original": { @@ -891,11 +891,11 @@ "xwayland-satellite-unstable": "xwayland-satellite-unstable" }, "locked": { - "lastModified": 1749991461, - "narHash": "sha256-6wXRZuUe5JmIVLiyP0NQ+2Rv4TOITtUxnhKhAvT6ep8=", + "lastModified": 1750084476, + "narHash": "sha256-KfkA0uftsNhhIZAwnqzH6Z0TEn3wKKXhI5lYJCaL8x4=", "owner": "sodiboo", "repo": "niri-flake", - "rev": "3f3f1573fcd823a45c7fbb21110fdadb9563fa27", + "rev": "94ff8b2da333c42cad4a1429d897b99bd5b27e57", "type": "github" }, "original": { @@ -924,11 +924,11 @@ "niri-unstable": { "flake": false, "locked": { - "lastModified": 1749797708, - "narHash": "sha256-P5x0U6AW5Zn20bARv4D83d8XlNaWK1st9QwBfSe+Vfg=", + "lastModified": 1750075148, + "narHash": "sha256-7n5dzueAsq5jEZBWZ4TSM+ydzKjPlcP0txBaevoGuqc=", "owner": "YaLTeR", "repo": "niri", - "rev": "f3f6e79eeca8924ff9cfea4b30006e5b782bc93e", + "rev": "da3dc913a60062343a5a76b8745e55173a150751", "type": "github" }, "original": { @@ -1021,11 +1021,11 @@ "website-builder": "website-builder" }, "locked": { - "lastModified": 1750027183, - "narHash": "sha256-a7g4Ord2Clf3bhli1S77zoV9/2dWkLc5JRpxKXXiz3c=", + "lastModified": 1750078297, + "narHash": "sha256-X3cKYw203B+YeERTm+uTZTw7znlWnrnTIvCy8pvL/mA=", "owner": "rasmus-kirk", "repo": "nixarr", - "rev": "4a4f2f761d2d7b7864d54577ac93df34ff0d209d", + "rev": "c0dd44c660a4395c7f856c92bf173f3d61b99c7a", "type": "github" }, "original": { @@ -1036,11 +1036,11 @@ }, "nixos-hardware": { "locked": { - "lastModified": 1749832440, - "narHash": "sha256-lfxhuxAaHlYFGr8yOrAXZqdMt8PrFLzjVqH9v3lQaoY=", + "lastModified": 1750083401, + "narHash": "sha256-ynqbgIYrg7P1fAKYqe8I/PMiLABBcNDYG9YaAP/d/C4=", "owner": "NixOS", "repo": "nixos-hardware", - "rev": "db030f62a449568345372bd62ed8c5be4824fa49", + "rev": "61837d2a33ccc1582c5fabb7bf9130d39fee59ad", "type": "github" }, "original": { @@ -1112,11 +1112,11 @@ }, "nixpkgs-stable": { "locked": { - "lastModified": 1749834526, - "narHash": "sha256-izgPGLeUeFB9loC+n2X6TO2n8pOGvVcR3jKqxTGOwgc=", + "lastModified": 1749995256, + "narHash": "sha256-LEGfcombb0otUf23oAmYCXR4+lMQKa49XmU0G5HItGI=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "db8414903dd6b3042e1ac471eafc18ca4ccb54a4", + "rev": "daa45f10955cc2207ac9c5f0206774d2f757c162", "type": "github" }, "original": { @@ -1128,11 +1128,11 @@ }, "nixpkgs-stable_2": { "locked": { - "lastModified": 1749857119, - "narHash": "sha256-tG5xUn3hFaPpAHYIvr2F88b+ovcIO5k1HqajFy7ZFPM=", + "lastModified": 1750005367, + "narHash": "sha256-h/aac1dGLhS3qpaD2aZt25NdKY7b+JT0ZIP2WuGsJMU=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "5f4f306bea96741f1588ea4f450b2a2e29f42b98", + "rev": "6c64dabd3aa85e0c02ef1cdcb6e1213de64baee3", "type": "github" }, "original": { @@ -1144,11 +1144,11 @@ }, "nixpkgs-stable_3": { "locked": { - "lastModified": 1749834526, - "narHash": "sha256-izgPGLeUeFB9loC+n2X6TO2n8pOGvVcR3jKqxTGOwgc=", + "lastModified": 1749995256, + "narHash": "sha256-LEGfcombb0otUf23oAmYCXR4+lMQKa49XmU0G5HItGI=", "owner": "nixos", "repo": "nixpkgs", - "rev": "db8414903dd6b3042e1ac471eafc18ca4ccb54a4", + "rev": "daa45f10955cc2207ac9c5f0206774d2f757c162", "type": "github" }, "original": { @@ -1673,11 +1673,11 @@ ] }, "locked": { - "lastModified": 1750027175, - "narHash": "sha256-6XM+hg3Zal2EqeDmTSpFyrvYLgM81BhFtLjA93nYA6Q=", + "lastModified": 1750076849, + "narHash": "sha256-si3V9rU0U9PXQ6/+h6CnnXFpBJCdYTnykx3+6bRtymU=", "owner": "rasmus-kirk", "repo": "website-builder", - "rev": "3825733413b78fe6cd4498cef8b339ae1e0a6a0e", + "rev": "437ab27159ca0b0f0675cd5890fdafeac385b25d", "type": "github" }, "original": { @@ -1776,11 +1776,11 @@ "rust-overlay": "rust-overlay_3" }, "locked": { - "lastModified": 1749888828, - "narHash": "sha256-D6suAjGrP3W3tXGrVffS7EMtMUNQEq0cBzQb5+vjMyY=", + "lastModified": 1750080339, + "narHash": "sha256-sH0qWYJjm6gYAvsU7lvDRiGbsXBj6sI05ymc2F0tNYM=", "owner": "sxyazi", "repo": "yazi", - "rev": "917fee939f23b00a6ea6180f74f7f0e76afc56f9", + "rev": "a0ab614108e26181a9cb92010592331bea582284", "type": "github" }, "original": { @@ -1797,11 +1797,11 @@ ] }, "locked": { - "lastModified": 1749991041, - "narHash": "sha256-+jss4bkSbzURttaspRke/LVtrthBRDoafJmn/xem5f0=", + "lastModified": 1750091187, + "narHash": "sha256-mjAol6qR+onnZwLUdYjmuBr/tnyozUBXz75tSePVU00=", "owner": "0xc000022070", "repo": "zen-browser-flake", - "rev": "ff841ca63c73796117f298c730d9f1dc2b18e7e7", + "rev": "cfdf98dac59a42e1642c533a5dbfb5bb242903b3", "type": "github" }, "original": { diff --git a/modules/home/desktop.nix b/modules/home/desktop.nix index 7f4a06c..54b6fdd 100644 --- a/modules/home/desktop.nix +++ b/modules/home/desktop.nix @@ -92,6 +92,7 @@ davinci-resolve-studio processing zotero + # nix-config.packages.x86_64-linux.zotero-latest fractal handbrake gmic diff --git a/modules/home/niri.nix b/modules/home/niri.nix index c0dd559..3476f55 100644 --- a/modules/home/niri.nix +++ b/modules/home/niri.nix @@ -161,12 +161,12 @@ in }; }; - # layer-rules = [ - # { - # matches = [ { namespace="^wpaperd$"; } ]; - # place-within-backdrop = true; - # } - # ]; + layer-rules = [ + { + matches = [ { namespace="^wpaperd$"; } ]; + place-within-backdrop = true; + } + ]; window-rules = [ # global window rule for shared config @@ -259,7 +259,7 @@ in min-width = 500; min-height = 400; - # tiled-state = false; + tiled-state = false; open-focused = true; } diff --git a/modules/home/yazi.nix b/modules/home/yazi.nix index 2aab1b7..bbc2ae6 100644 --- a/modules/home/yazi.nix +++ b/modules/home/yazi.nix @@ -127,7 +127,7 @@ # This will reset any preference changes for the current working directory (CWD) # then fall back to the predefined preferences in init.lua or yazi.toml - { on = [ "," "R" ]; run = [ "plugin pref-by-location -- reset" ]; desc = "Retpreference of cwd"; } + { on = [ "," "R" ]; run = [ "plugin pref-by-location -- reset" ]; desc = "Reset preference of cwd"; } { on = [ "," "m" ]; run = [ "sort mtime --reverse=no" "linemode mtime" "plugin pref-by-location -- save" ]; desc = "Sort by modified time"; } { on = [ "," "M" ]; run = [ "sort mtime --reverse" "linemode mtime" "plugin pref-by-location -- save" ]; desc = "Sort by modified time (reverse)"; } { on = [ "," "b" ]; run = [ "sort btime --reverse=no" "linemode btime" "plugin pref-by-location -- save" ]; desc = "Sort by birth time"; } diff --git a/modules/home/yazi/init.lua b/modules/home/yazi/init.lua index 1e21d92..0dd194c 100644 --- a/modules/home/yazi/init.lua +++ b/modules/home/yazi/init.lua @@ -44,14 +44,8 @@ pref_by_location:setup({ -- show_hidden: true|false (Optional) https://yazi-rs.github.io/docs/configuration/yazi#mgr.show_hidden - -- Some examples: - -- Match any folder which has path start with "/mnt/remote/". Example: /mnt/remote/child/child2 - -- { location = "^/mnt/remote/.*", sort = { "extension", reverse = false, dir_first = true, sensitive = false} }, -- Match any folder with name "Downloads" - { location = ".*/Downloads", sort = { "btime", reverse = true, dir_first = true }, linemode = "btime" }, - -- Match exact folder with absolute path "/home/test/Videos". - -- Use helper function `pref_by_location.is_literal_string` to prevent the case where the path contains special characters - -- { location = pref_by_location.is_literal_string("/home/test/Videos"), sort = { "btime", reverse = true, dir_first = true }, linemode = "btime" }, + { location = ".*/Downloads", sort = { "mtime", reverse = true, dir_first = false }, linemode = "time_and_size" }, }, }) diff --git a/overlays/zotero.nix b/overlays/zotero.nix deleted file mode 100644 index eb3f60d..0000000 --- a/overlays/zotero.nix +++ /dev/null @@ -1,10 +0,0 @@ -final: prev: { - zotero-latest = prev.zotero-beta.overrideAttrs (old: { - version = "7.1-beta.37+Be50787c94"; - - src = prev.fetchurl { - url = "https://download.zotero.org/client/beta/7.1-beta.37%2Be50787c94/Zotero-7.1-beta.37%2Be50787c94_linux-x86_64.tar.bz2"; - hash = "sha256-PrFd1k6jUl/3r5nidcA8pGFoIlR2otm1hB+fNnF1x4M="; - }; - }); -} diff --git a/packages/zotero-latest.nix b/packages/zotero-latest.nix new file mode 100644 index 0000000..f6fb28f --- /dev/null +++ b/packages/zotero-latest.nix @@ -0,0 +1,149 @@ +{ + lib, + stdenv, + fetchurl, + wrapGAppsHook3, + makeDesktopItem, + alsa-lib, + atk, + cairo, + dbus-glib, + firefox-esr, + gdk-pixbuf, + glib, + gtk3, + libGL, + nspr, + nss, + xorg, + libgbm, + pango, + pciutils, +}: + +stdenv.mkDerivation rec { + pname = "zotero-latest"; + version = "7.1-beta.38+408f1274f"; + + src = + let + escapedVersion = lib.escapeURL version; + in + fetchurl { + url = "https://download.zotero.org/client/beta/${escapedVersion}/Zotero-${escapedVersion}_linux-x86_64.tar.bz2"; + hash = "sha256-Omx4UjIoxZIpAY4XP4Az5aIU5UAIP0X8QtBMEmu9ySo="; + }; + + dontPatchELF = true; + nativeBuildInputs = [ wrapGAppsHook3 ]; + + libPath = + lib.makeLibraryPath [ + alsa-lib + atk + cairo + dbus-glib + gdk-pixbuf + glib + gtk3 + libGL + xorg.libX11 + xorg.libXcomposite + xorg.libXcursor + xorg.libXdamage + xorg.libXext + xorg.libXfixes + xorg.libXi + xorg.libXrandr + xorg.libXtst + xorg.libxcb + libgbm + pango + pciutils + ] + + ":" + + lib.makeSearchPathOutput "lib" "lib" [ stdenv.cc.cc ]; + + desktopItem = makeDesktopItem { + name = "zotero"; + exec = "zotero -url %U"; + icon = "zotero"; + comment = meta.description; + desktopName = "Zotero"; + genericName = "Reference Management"; + categories = [ + "Office" + "Database" + ]; + startupNotify = true; + mimeTypes = [ + "x-scheme-handler/zotero" + "text/plain" + ]; + }; + + installPhase = '' + runHook preInstall + + pkg_dir="$prefix/usr/lib/zotero-bin-${version}" + + # Copy package contents to the output directory + mkdir -p "$pkg_dir" + cp -r * "$pkg_dir" + + ln -sf ${nss}/lib/libfreeblpriv3.so "$pkg_dir/libfreeblpriv3.so" + ln -sf ${firefox-esr}/lib/firefox/libgkcodecs.so "$pkg_dir/libgkcodecs.so" + ln -sf ${firefox-esr}/lib/firefox/libmozsqlite3.so "$pkg_dir/libmozsqlite3.so" + ln -sf ${nspr}/lib/libnspr4.so "$pkg_dir/libnspr4.so" + ln -sf ${nss}/lib/libnss3.so "$pkg_dir/libnss3.so" + ln -sf ${nss}/lib/libnssckbi.so "$pkg_dir/libnssckbi.so" + ln -sf ${nss}/lib/libnssutil3.so "$pkg_dir/libnssutil3.so" + ln -sf ${nss}/lib/libsoftokn3.so "$pkg_dir/libsoftokn3.so" + ln -sf ${nss}/lib/libssl3.so "$pkg_dir/libssl3.so" + ln -sf ${firefox-esr}/lib/firefox/libxul.so "$pkg_dir/libxul.so" + + mkdir -p "$out/bin" + ln -s "$pkg_dir/zotero" "$out/bin/" + + # Install desktop file and icons + mkdir -p $out/share/applications + cp ${desktopItem}/share/applications/* $out/share/applications/ + for size in 32 64 128; do + install -Dm444 icons/icon''${size}.png \ + $out/share/icons/hicolor/''${size}x''${size}/apps/zotero.png + done + install -Dm444 icons/symbolic.svg \ + $out/share/icons/hicolor/symbolic/apps/zotero-symbolic.svg + + runHook postInstall + ''; + + postFixup = '' + for executable in \ + zotero-bin plugin-container updater vaapitest \ + minidump-analyzer glxtest + do + if [ -e "$out/usr/lib/zotero-bin-${version}/$executable" ]; then + patchelf --interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \ + "$out/usr/lib/zotero-bin-${version}/$executable" + fi + done + find . -executable -type f -exec \ + patchelf --set-rpath "$libPath" \ + "$out/usr/lib/zotero-bin-${version}/{}" \; + ''; + + meta = { + homepage = "https://www.zotero.org"; + downloadPage = "https://www.zotero.org/support/beta_builds"; + description = "Collect, organize, cite, and share your research sources"; + mainProgram = "zotero"; + sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ]; + license = lib.licenses.agpl3Only; + platforms = [ "x86_64-linux" ]; + maintainers = with lib.maintainers; [ + atila + justanotherariel + ]; + }; +}