How to install dependecies?

I’m trying to make the nemo file manager display avif thumbnails.

I was told that just installing the package for that function (e.g. imagemagick has everything for every image format) doesn’t work. And that i needed to install those packages as dependencies for nemo.

How do i do that?

I`m using NixOS 23.11.

Did you actually try if it works if you just install imagemagick?

If it doesn’t, i’m going on a limb here so you’ll get an idea (i’m neither very knowledgeable nor have i tried it myself):

Does it work if you add the following to your configuration.nix?

nixpkgs.overlays = [
        (final: prev: {
        cinnamon.nemo =
          prev.cinnamon.nemo.override
          {
            buildInputs = [
              final.glib
              final.gtk3
              final.cinnamon-desktop
              final.libxml2
              final.xapp
              final.libexif
              final.exempi
              final.gvfs
              final.libgsf
              final.libavi
            ];
          };
      })
  ];

Sorry but this doesn`t work. I get:


       error: function 'anonymous lambda' called with unexpected argument 'buildInputs'

       at /nix/store/94vj8796x53xzc12g3bqjxfqbcnkm2i3-nixos-23.11.4835.c8e74c2f83fe/nixos/pkgs/desktops/cinnamon/nemo/default.nix:1:1:

            1| { fetchFromGitHub
             | ^
            2| , fetchpatch

There are several problems with the proposed code:

  • To override arguments of stdenv.mkDerivation, one should use overrideAttrs. override is for overriding the arguments of the expression (as injected by callPackage).
  • Overlays are not merged recursively, so overlaying cinnamon.nemo will replace the whole cinnamon namespace with just { nemo = …; }.
  • Replacing the whole buildInputs will break on updates when new inputs are added in Nixpkgs, you should append to the original version.
  • libavi does not exist, it should be libavif.
  • You cannot just add random package like imagemagick and expect it to do anything, Nemo needs to support it. Assuming Nemo uses the same thumbnailer mechanism like Nautilus (i.e. cinnamon-desktop is a straight fork of gnome-desktop), we need packages that have a thumbnailer file in share/thumbnailers directory.

The overlay should be something like the following (untested):

(final: prev: {
  cinnamon = prev.cinnamon.overrideScope (cfinal: cprev: {
    nemo = cprev.nemo.overrideAttrs (attrs: {
      preFixup = attrs.preFixup or "" + ''
        gappsWrapperArgs+=(
          --prefix XDG_DATA_DIRS : "${final.shared-mime-info}/share"
          # Thumbnailers
          --prefix XDG_DATA_DIRS : "${final.gdk-pixbuf}/share"
          --prefix XDG_DATA_DIRS : "${final.librsvg}/share"
          --prefix XDG_DATA_DIRS : "${final.webp-pixbuf-loader}/share"
          --prefix XDG_DATA_DIRS : "${final.libavif}/share"
        )
      '';
    });
  });
})
1 Like