diff --git a/packages/handy.nix b/packages/handy.nix index 502b03d..5916551 100644 --- a/packages/handy.nix +++ b/packages/handy.nix @@ -1,3 +1,4 @@ +# https://handy.computer/ { appimageTools, fetchurl, diff --git a/packages/inkdrop.nix b/packages/inkdrop.nix new file mode 100644 index 0000000..8511bc0 --- /dev/null +++ b/packages/inkdrop.nix @@ -0,0 +1,149 @@ +# https://www.inkdrop.app/ +{ + lib, + fetchurl, + stdenv, + autoPatchelfHook, + makeWrapper, + wrapGAppsHook3, + alsa-lib, + at-spi2-atk, + at-spi2-core, + cairo, + cups, + dbus, + expat, + gdk-pixbuf, + glib, + gtk3, + libdrm, + libnotify, + libpulseaudio, + libsecret, + libuuid, + libxkbcommon, + mesa, + nspr, + nss, + pango, + systemd, + libx11, + libxscrnsaver, + libxcomposite, + libxcursor, + libxdamage, + libxext, + libxfixes, + libxi, + libxrandr, + libxrender, + libxtst, + libxcb, + libxkbfile, + libxshmfence, +}: +stdenv.mkDerivation rec { + pname = "inkdrop"; + version = "5.11.8"; + + src = fetchurl { + url = "https://dist.inkdrop.app/v${version}/${pname}_${version}_amd64.deb"; + hash = "sha256-8aJSeUi5K9PgNJvfYAtnRnI2t+vM10jiqVAZmX+zni0="; + }; + + nativeBuildInputs = [ + autoPatchelfHook + makeWrapper + wrapGAppsHook3 + ]; + + buildInputs = [ + alsa-lib + at-spi2-atk + at-spi2-core + cairo + cups + dbus + expat + gdk-pixbuf + glib + gtk3 + libdrm + libnotify + libpulseaudio + libsecret + libuuid + libxkbcommon + mesa + nspr + nss + pango + systemd + libx11 + libxscrnsaver + libxcomposite + libxcursor + libxdamage + libxext + libxfixes + libxi + libxrandr + libxrender + libxtst + libxcb + libxkbfile + libxshmfence + ]; + + dontBuild = true; + dontConfigure = true; + + # Ignore musl dependency since we're using glibc + autoPatchelfIgnoreMissingDeps = [ "libc.musl-x86_64.so.1" ]; + + unpackPhase = '' + runHook preUnpack + + # Extract deb file manually to avoid setuid issues + ar x $src + tar xf data.tar.xz --no-same-permissions --no-same-owner + + runHook postUnpack + ''; + + installPhase = '' + runHook preInstall + + # Create output directories + mkdir -p $out/bin $out/share + + # Copy the main application + cp -r usr/lib/inkdrop $out/share/inkdrop + + # Copy desktop file and icon + cp -r usr/share/applications $out/share/ + cp -r usr/share/pixmaps $out/share/ + + # Fix desktop file to use absolute paths + substituteInPlace $out/share/applications/inkdrop.desktop \ + --replace-quiet "Exec=inkdrop" "Exec=$out/bin/inkdrop" \ + --replace-quiet "Icon=inkdrop" "Icon=$out/share/pixmaps/inkdrop.png" + + # Create wrapper script in bin + makeWrapper $out/share/inkdrop/inkdrop $out/bin/inkdrop \ + --add-flags "\''${NIXOS_OZONE_WL:+\''${WAYLAND_DISPLAY:+--ozone-platform-hint=auto --enable-features=WaylandWindowDecorations}}" \ + --set-default ELECTRON_IS_DEV 0 \ + --inherit-argv0 + + runHook postInstall + ''; + + meta = with lib; { + description = "Notebook app for Markdown lovers"; + homepage = "https://www.inkdrop.app/"; + license = licenses.unfree; + maintainers = [ ]; + platforms = [ "x86_64-linux" ]; + mainProgram = "inkdrop"; + }; +} diff --git a/users/phundrak/packages.nix b/users/phundrak/packages.nix index 280dd85..6d0cf21 100644 --- a/users/phundrak/packages.nix +++ b/users/phundrak/packages.nix @@ -7,6 +7,7 @@ with lib; let inherit (pkgs.stdenv.hostPlatform) system; handy = pkgs.callPackage ../../packages/handy.nix {}; + inkdrop = pkgs.callPackage ../../packages/inkdrop.nix {}; pumo-system-info = inputs.pumo-system-info.packages.${system}.default; zen = inputs.zen-browser.packages.${system}.default; in { @@ -72,6 +73,7 @@ in { # Dev dbeaver-bin devenv + inkdrop nodejs sqlite tectonic # better LaTeX engine