I installed dovecot and with it came a tool called maildirlock that I would like to use. It's not in PATH, but it is in /nix/store. Multiple times in different versions, of course (and they can be found with find /nix/store/ -iname "maildirlock").

How do I identify the version matching the currently installed (and running) dovecot? What is the idiomatic way for doing so? Is there a tool for this?


The package puts it in ${pkgs.dovecot}/libexec/dovecot/maildirlock, so it's not even in directory that is normally put on $PATH.

You can certainly work around it in some ways, e.g. modify your configuration.nix accordingly:

systemPackages = [
  (pkgs.runCommand "maildirlock" {}
    "mkdir -p $out/bin && ln -s ${pkgs.dovecot}/libexec/dovecot/maildirlock $out/bin/"
  • 2
    For me the take away message is that pkgs.dovecot evaluates to the correct path in /nix/store where dovecot and thus maildirlock is installed. Thanks! – phdoerfler Jan 3 '18 at 22:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.