[Nix-dev] Setting up crontab as nixos user

Bjørn Forsman bjorn.forsman at gmail.com
Fri Sep 5 21:17:59 CEST 2014


I tried exporting some environment variables in the cron nixos module.
But cron insists on controlling the environment it gives to child
processes and throws away the variables I give it. Too bad.

I see the same issue on Ubuntu where the system crontab has a PATH=...
line including among other things /usr/local/bin. But as this is not
propagated to user crontab, the processes run there get the default
path of /usr/bin:/bin (same as on NixOS).

IMHO, someone (upstream) should fix cron to stop messing with the
environment. The current behaviour may have been appropriate in the
SysV init days, but now we have better ways to control cron's
environment (i.e. systemd).

Best regards,
Bjørn Forsman


More information about the nix-dev mailing list