AppImage request

Hello!

It would be immensely appreciated if you could provide an AppImage of Inkdrop. In addition to Ubuntu (where Inkdrop has worked great!), I also use a Linux distribution called NixOS, and due to NixOS’s design, it is rather difficult to package most closed source software – though AppImage would be trivial to support.

I’m a major contributor to (and package developer for) NixOS, and I would love to add seamless support for Inkdrop (and tell all of my NixOS friends to check out Inkdrop). Would it be possible for you to provide an AppImage build, pretty please? :smiley:

1 Like

Hi Charles,

Thank you for the suggestion.
Providing an AppImage would be nice.
Since I’m developing it alone and haven’t ever used NixOS, would you help me make it?
Here is the Snap package that would be helpful for making it:

1 Like

Hi Takuya,

Time permitting, I might see if I can help with an AppImage.

Other exciting news: I managed to write a NixOS package for Inkdrop that appears to be fully working (including plugins):

{ stdenv, alsaLib, atk, at-spi2-atk, cairo, cups, dbus, dpkg, expat, fontconfig, freetype
, fetchurl, gdk-pixbuf, glib, gtk2, gtk3, libpulseaudio, makeWrapper, nspr
, nss, pango, udev, xorg
, libuuid, at-spi2-core, libsecret
, coreutils
}:

let
  version = "5.2.1";

  deps = [
    libuuid
    libsecret
    alsaLib
    atk
    at-spi2-atk
    at-spi2-core
    cairo
    cups
    dbus
    expat
    fontconfig
    freetype
    gdk-pixbuf
    glib
    gtk2
    gtk3
    libpulseaudio
    nspr
    nss
    pango
    stdenv.cc.cc
    udev
    xorg.libX11
    xorg.libxcb
    xorg.libXcomposite
    xorg.libXcursor
    xorg.libXdamage
    xorg.libXext
    xorg.libXfixes
    xorg.libXi
    xorg.libXrandr
    xorg.libXrender
    xorg.libXScrnSaver
    xorg.libXtst
    xorg.libxkbfile
  ];

in

stdenv.mkDerivation {
  pname = "inkdrop";
  inherit version;

  src = fetchurl {
    url = "https://d3ip0rje8grhnl.cloudfront.net/v${version}/inkdrop_${version}_amd64.deb";
    hash = "sha256-JI0H25Bu7uk3ASMo65Gv1YxPc9tC+tAb7M7wFPMyvxk=";
  };

  dontBuild = true;
  buildInputs = [ dpkg makeWrapper ];

  unpackPhase = ''
    dpkg --fsys-tarfile $src | tar --extract
  '';

  installPhase = ''
    rm -r ./usr/share/lintian
    rm -r ./usr/share/doc

    mkdir -p $out
    cp -r ./usr/share $out
    cp -r ./usr/bin $out
    cp -r ./usr/lib $out

    patchelf --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
             "$out/lib/inkdrop/inkdrop"

    patchelf --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
             "$out/lib/inkdrop/resources/app/ipm/bin/node"

    wrapProgram $out/lib/inkdrop/inkdrop \
      --prefix LD_LIBRARY_PATH : "$out/lib/inkdrop" \
      --prefix LD_LIBRARY_PATH : "${stdenv.lib.makeLibraryPath deps}"

    wrapProgram $out/lib/inkdrop/resources/app/ipm/bin/ipm \
      --prefix PATH : "${coreutils.out}/bin" \
      --prefix LD_LIBRARY_PATH : "$out/lib/inkdrop" \
      --prefix LD_LIBRARY_PATH : "${stdenv.lib.makeLibraryPath deps}"
  '';

  meta = {
    homepage = "https://www.inkdrop.app/";
    description = "Organizing your Markdown notes made simple";
    license = stdenv.lib.licenses.unfreeRedistributable;
    platforms = [ "x86_64-linux" ];
    maintainers = [ stdenv.lib.maintainers.cstrahan ];
  };
}

I’ll see if I can get this merged into Nixpkgs.

4 Likes

That’s great news!
Thanks so much for the work :pray::raised_hands:

2 Likes

Hi @Charles_Strahan, I’m using your expression for Nix and I get this error, any idea?

Thanks!

Any idea here @craftzdog?

Thanks!

I’m getting this error after update to 5.5.0:

image

you need to install gnome-keyring or other similar keyring that can stores secrets. Or if it’s already installed in the case of NixOS (I’ve never actually used it) you might need to start/enable the service.

2 Likes

Solved!

I had to add gnome.gnome-keyring service to my configuration.nix file.

I’ve updated the @Charles_Strahan nix expression to the last version and works fine:

{ stdenv
, lib
, libxkbcommon
, libdrm
, alsaLib
, atk
, at-spi2-atk
, cairo
, cups
, dbus
, dpkg
, expat
, fontconfig
, freetype
, fetchurl
, gdk-pixbuf
, glib
, gtk2
, gtk3
, libpulseaudio
, makeWrapper
, nspr
, nss
, pango
, udev
, xorg
, libuuid
, at-spi2-core
, libsecret
, coreutils
, mesa
, gnome
}:

let
  version = "5.5.0";

  deps = [
    libxkbcommon
    libuuid
    libdrm
    libsecret
    alsaLib
    atk
    at-spi2-atk
    at-spi2-core
    cairo
    cups
    dbus
    expat
    fontconfig
    freetype
    gdk-pixbuf
    glib
    gtk2
    gtk3
    libpulseaudio
    nspr
    nss
    pango
    stdenv.cc.cc
    udev
    xorg.libX11
    xorg.libxcb
    xorg.libXcomposite
    xorg.libXcursor
    xorg.libXdamage
    xorg.libXext
    xorg.libXfixes
    xorg.libXi
    xorg.libXrandr
    xorg.libXrender
    xorg.libXScrnSaver
    xorg.libXtst
    xorg.libxkbfile
    xorg.libxshmfence
    mesa
    gnome.gnome-keyring
  ];

in

stdenv.mkDerivation {
  pname = "inkdrop";
  inherit version;

  src = fetchurl {
    url = "https://d3ip0rje8grhnl.cloudfront.net/v${version}/inkdrop_${version}_amd64.deb";
    # hash = "sha256-JI0H25Bu7uk3ASMo65Gv1YxPc9tC+tAb7M7wFPMyvxk=";
    # hash = "sha256:06dz6bri9w6fxhdx1yj2vdrlz36mmy8yna1304vykvkfj3dhg394";
    # hash = "sha256:183rnh965nxn5vzkgn2q087j0lzi6ly1jg5w3q44zgc8jrgzxyc8";
    hash = "sha256:1l8fxx7p2bg7fck2da9cj0g1xx9ql32v5hyqxjkwarv0xz0fv24f";
  };

  dontBuild = true;
  buildInputs = [ dpkg makeWrapper ];

  unpackPhase = ''
    dpkg --fsys-tarfile $src | tar --extract
  '';

  installPhase = ''
    rm -r ./usr/share/lintian
    rm -r ./usr/share/doc

    mkdir -p $out
    cp -r ./usr/share $out
    cp -r ./usr/bin $out
    cp -r ./usr/lib $out

    patchelf --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
             "$out/lib/inkdrop/inkdrop"

    patchelf --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
             "$out/lib/inkdrop/resources/app/ipm/bin/node"

    wrapProgram $out/lib/inkdrop/inkdrop \
      --prefix LD_LIBRARY_PATH : "$out/lib/inkdrop" \
      --prefix LD_LIBRARY_PATH : "${lib.makeLibraryPath deps}"

    wrapProgram $out/lib/inkdrop/resources/app/ipm/bin/ipm \
      --prefix PATH : "${coreutils.out}/bin" \
      --prefix LD_LIBRARY_PATH : "$out/lib/inkdrop" \
      --prefix LD_LIBRARY_PATH : "${lib.makeLibraryPath deps}"
  '';

  meta = with lib; {
    homepage = "https://www.inkdrop.app/";
    description = "Organizing your Markdown notes made simple";
    license = licenses.unfreeRedistributable;
    platforms = [ "x86_64-linux" ];
    maintainers = [ maintainers.cstrahan ];
  };
}

cc @craftzdog :slight_smile:

2 Likes

@anon94533569 awesome :tada:

@anon94533569 and @Charles_Strahan I copied your configuration.nix file but seem to be having the following error:

error: anonymous function at /nix/store/hsd831yk61nkxww276g94n4gmyyfxa0f-source/home-manager/inkdrop.nix:1:1 called with unexpected argument 'inputs'

       at /nix/store/9qaip1bfz0wjb8503a3vw66fqnqmgwai-source/lib/modules.nix:490:8:

          489|       # works.
          490|     in f (args // extraArgs)
             |        ^
          491|   else
(use '--show-trace' to show detailed location information)

Have you had this issue? Or do you have a working nixos configuration file on Github that is available?