Skip to content

Commit

Permalink
Wrap zotero
Browse files Browse the repository at this point in the history
  • Loading branch information
b3nj5m1n committed Nov 4, 2023
1 parent b80323e commit 60ba2d0
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 1 deletion.
2 changes: 1 addition & 1 deletion nix/modules/nixos/desktop.nix
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@
mpv
vlc
zathura
zotero
gsmartcontrol
swww
(callPackage ../../pkgs/zotero-wrapped {})
(callPackage ../../pkgs/logseq-wrapped {})
(callPackage ../../pkgs/firefox-trapped {})
];
Expand Down
32 changes: 32 additions & 0 deletions nix/pkgs/zotero-wrapped/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
stdenv,
pkgs,
}:
stdenv.mkDerivation {
name = "zotero-wrapped";
version = "1.0";

buildInputs = with pkgs; [
zotero
libnotify
];

src = pkgs.writeShellScriptBin "zotero-wrapper.sh" ''
${pkgs.libnotify}/bin/notify-send "Zotero" "Syncing zotero database";
/usr/bin/env sh /home/b3nj4m1n/.local/share/bin/auto_commit.sh /home/b3nj4m1n/Zotero false
${pkgs.zotero}/bin/zotero
${pkgs.libnotify}/bin/notify-send "Zotero" "Syncing zotero database";
/usr/bin/env sh /home/b3nj4m1n/.local/share/bin/auto_commit.sh /home/b3nj4m1n/Zotero false
'';

installPhase = ''
mkdir -p $out/bin
cp $src/bin/zotero-wrapper.sh $out/bin/zotero
chmod +x $out/bin/zotero
cp -r ${pkgs.zotero}/share $out/
'';

meta = {
conflicts = [{name = "zotero";}];
};
}

0 comments on commit 60ba2d0

Please sign in to comment.