I installed plocate
using configuration.nix
file:
environment = {
systemPackages = with pkgs; [
....
plocate
];
};
But I have tried to enable the associated systemd units in configuration.nix
but it fails:
$ cat configuration.nix
....
services = {
plocate.enable = true;
....
$ doas nixos-rebuild switch
error: The option `services.plocate' does not exist. Definition values:
- In `/etc/nixos/configuration.nix':
{
enable = true;
}
(use '--show-trace' to show detailed location information)
building Nix...
{
services.locate = {
enable = true;
locate = pkgs.plocate;
};
}
maxc
March 11, 2024, 7:25am
3
I had warnings
trace: warning: The option `services.locate.locate' defined in `/etc/nixos/configuration.nix' has been renamed to `services.locate.package'.
trace: warning: mlocate and plocate do not support the services.locate.localuser option. updatedb will run as root. Silence this warning by setting services.locate.localuser = null.
so I used
services.locate = {
enable = true;
package = pkgs.plocate;
localuser = null;
};
No idea what the localuser
option exactly means.
Did you come up with a working solution that you are happy with?
did you read the comment directly above yours?
Yes but I was not clear if this was the final solution he ended up with
That’s basically what I use as well, it works.