Change:
prints The message seems misleading as everything works as expected, even as a regular user. = { enable = true; locate = pkgs.mlocate; }; System: (NixOS: ) Nix version: () Nixpkgs version: ()
This still happens, although its a correct warning
That's surprising since it works for me without root. I only experienced issues when the wrong binary is used. If I recall correctly has higher priority and causes this. Can you check the output of or paste whatever error you get?
Sorry hit the wrong button by accident.
The warning is correct, but the wording is misleading. What it’s trying to warn you is not that will only run as , but rather that will run as . You can prevent the warning from being shown (with no other effect) by explicitly requesting that run as with .
This is warning is still confusing to me. If I'm building an index of files, I'd expect that if I run it as a non privileged user many files will not be reachable and therefore these won't end up in the locate database/index. Given the way works, I'd also expect to have one database per system, not one per user. So from this my expectation is that can only successfully index everything if run as . In other words, I'm still not sure what is the purpose or goal of the message. Is it just that the command needs to run as ? is this bad in any way? why is this special given the purpose of the tool? Is it that the fact that it runs as is in some way a security concern? Is this to clarify that despite the existence of an group (and user?) these are not actually used for indexing, or is the point something else entirely. Do other tools work in such a different way that justifies the existence of this warning for ?
mlocate’s doesn’t have a option like findutils’ does. Therefore, the NixOS module ignores when using mlocate (). It prints a warning to indicate that your expectation has been violated. The group is there so that the mlocate binary can be setgid rather than setuid . Given that mlocate is designed with an that indexes everything and a that only shows you your own files, there doesn’t seem to be much point in running mlocate’s as another user. If you want that, why not switch back to findutils?
I see, in this context, the above makes sense. I actually want the full system indexing. To me has always been a synonym of , except several times faster. Thanks for the clarification!
Hello, I'm a bot and I thank you in the name of the community for opening this issue. To help our human contributors focus on the most-relevant reports, I check up on old issues to see if they're still relevant. This issue has had no activity for 180 days, and so I marked it as stale, but you can rest assured it will never be closed by a non-human. The community would appreciate your effort in checking if the issue is still valid. If it isn't, please close it. If the issue persists, and you'd like to remove the stale label, you simply need to leave a comment. Your comment can be as simple as "still important to me". If you'd like it to get more attention, you can ask for help by searching for maintainers and people that previously touched related code and @ mention them in a comment. You can use or on the relevant files to find them. Lastly, you can always ask for help at or at .
Could you include your commit in a pull request? I think that's a good solution and we can close this issue.
It’s been in this whole time.
My bad, I read only the latest updates and the pull request was higher up. Did a bit of noise on the pull request. It's a harmless change so I was surprised to see it sitting there for this long.
To avoid , this is needed: it's needed because it creates the group. That error happens when using: with or without: and then doing something like . But if not using the (so only using the alone) then there's no error, because the service itself uses a different package's by default, it's from package. The source: EDIT: I made some mistakes initially, you can see post history for that.

Discussion:
{ LOCATE_PATH = cfg.output; }; <del> warnings = optional (isMLocate && cfg.localuser != null) "mlocate does not support searching as user other than root" </del> <ins> warnings = optional (isMLocate && cfg.localuser != null) "mlocate does not support the services.locate.localuser option; updatedb will run as root. (Silence with services.locate.localuser = null.)" </ins> ++ optional (isFindutils && cfg.pruneNames != []) "findutils locate does not support pruning by directory component" ++ optional (isFindutils && cfg.pruneBindMounts) "findutils locate does not support skipping bind mounts";