It's easier to generate a package that wraps the script binary and then use
it in a cronjob

On Wed, Oct 7, 2015 at 11:17 PM, Bjørn Forsman <[email protected]>
wrote:

> On 7 October 2015 at 22:06, Anders Lundstedt <[email protected]>
> wrote:
> > A python script I have depends on the requests2 package. I can run the
> > script using
> >
> > nix-shell --pure -p python3 -p python3Packages.requests2 --run
> ./my-script.py
> >
> >
> > However when putting this line as a cron job I get the cron output:
> >
> > error: Nix database directory ‘/nix/var/nix/db’ is not writable:
> > Permission denied
> >
> >
> > What solutions are there to run a simple script with dependencies as a
> > cron job, other than to add the script as a package?
>
> I think that means the cron job does not have the environment variable
> NIX_REMOTE set to "daemon". Try setting it, one way or the other, and
> the command should work.
>
> - Bjørn
> _______________________________________________
> nix-dev mailing list
> [email protected]
> http://lists.science.uu.nl/mailman/listinfo/nix-dev
>
_______________________________________________
nix-dev mailing list
[email protected]
http://lists.science.uu.nl/mailman/listinfo/nix-dev

Reply via email to