Cannot install direvent even if it seems well packaged

I am unable to install the direvent monitoring daemon – a GNU project that strengthens inotify.

AFAIK direvent seems well packaged though, with its callPackage line in all-packages.nix.

I tried to install it using an up to date nixpkgs local repo

nix-env -iA nixos.direvent -I nixpkgs=/home/<user>/Dev/nixpkgs

without any success. Installing packages, like dejagnu or lattice-diamond (at the same location in nixpkgs), work fine.

What am I missing here ?


EDIT

cd nixpkgs/pkgs/development/tools/misc/direvent
nix-build -E 'with import <nixpkgs> { }; callPackage ./default.nix { }'

works, but I still need the standard way to install direvent for my project.

This package is not available in 19.09. You can upgrade to 20.03 however to install it.
It is also possible import a newer nixpkgs tarball in your project’s shell.nix.

Even if I use the nixos-unstable branch of nixpkgs-channels repo ?

It is in my nixos-unstable channel. Is your nixos-unstable channel out-of-date or do you by chance not the channel you think you use?

What is really surprising is that direvent is in my local nixpkgs tree. I can see it. My local nixpkgs is a clone of the nixos-unstable branch of the nixpkgs-channels repository.

Can you install direvent ?

Yes, what is the output of nix-shell -p nix-info --run "nix-info -m" on your machine?

 - system: `"x86_64-linux"`
 - host os: `Linux 5.4.30, NixOS, 19.09.2370.e10c65cdb35 (Loris)`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.3.3`
 - channels(jlucas): `"home-manager"`
 - channels(root): `"nixos-19.09.2370.e10c65cdb35"`
 - nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/nixos`

You are not using the unstable channel. You are using nixos-19.09.2370.e10c65cdb35

I thought that the option -I nixpkgs=/home/<user>/Dev/nixpkgs superseded the configured channel.

Yes. If you are using nixos-rebuild or nix-shell. For nix-env use: nix-env -f /home/<user>/Dev/nixpkgs -iA direvent

Ok thanks, that works fine :slight_smile:

In nix-env manual I read

Paths added through -I take precedence over NIX_PATH.

thus I thought that it would precede the configured 19.09 nix-channel.
I need to understand more how channels are linked to NIX_PATH I guess.

I have also not really understand how channels or nix-env works in detail. I have a nixpkgs checkout in my NIX_PATH and use nixos-rebuild/home-manager.

if you pass -I nixpkgs=/home/<user>/Dev/nixpkgs I think you should run nix-env -iA nixpkgs.direvent

I tried with nixpkgs.direvent instead of nixos.direvent. Updating to nixos-20.03 solves my issue anyway – even if I still do not fully understand what was wrong.