Pass Extensions on NixOS

In case you want to use extensions like pass-otp or pass-import with “the standard unix password manager” NixOS is using a special package specification.

Installing the packages separately will raise no error, but pass import will not provide the expected feature, instead it tries to lookup a password entry for import.

If you want to use pass without any extensions you can just add pass to your list of software packages (environment.systemPackages or users.users.USERNAME.packages).

If you add passExtensions.pass-import independently to the list the pass import command will not find the extension.

For me adding the instructions by pass-otp in additional (...) as list entry fixes the relationship.

users.users.USERNAME = {
  ...
  packages = with pkgs; [
    ...
    (pass.withExtensions (exts: [ exts.pass-otp exts.pass-import ]))
  ];
};