If you're comfortable having it suid, you could set security.suidPrograms = [ "xautolock" ]; in configuration.nix. Then if xautolock is installed globally it will hopefully work without sudo.
On 8 February 2015 at 10:07, Nikita Karetnikov <nik...@karetnikov.org> wrote: > How do I automatically lock the screen in NixOS? I've installed > xautolock and slock. And tested > > sudo xautolock -time 1 -locker slock > > in the shell, which works fine. Can I make it work without sudo? > > It's a problem because these lines in configuration.nix: > > displayManager.sessionCommands = > '' > sudo xautolock -time 1 -locker slock & > ''; > > result in > > sudo: no tty present and no askpass program specified > > So it fails to start. > > _______________________________________________ > nix-dev mailing list > nix-dev@lists.science.uu.nl > http://lists.science.uu.nl/mailman/listinfo/nix-dev > >
_______________________________________________ nix-dev mailing list nix-dev@lists.science.uu.nl http://lists.science.uu.nl/mailman/listinfo/nix-dev