On 8 October 2015 at 14:48, Eelco Dolstra <[email protected]> wrote:
> Hi,
>
> On 08/10/15 09:23, Bjørn Forsman wrote:
>
>> On 8 October 2015 at 09:18, Domen Kožar <[email protected]> wrote:
>>> It's easier to generate a package that wraps the script binary and then use
>>> it in a cronjob
>>
>> Or just "nix-shell ... --run "NIX_REMOTE=daemon ./my-script.py"?
>
> Surely that should be "NIX_REMOTE=daemon NIX_PATH=... nix-shell -p ...".
> Otherwise you're setting the environment variable too late, and you need
> NIX_PATH for the -p flag to work.
>
> Even better is using a systemd timer instead of a cronjob, e.g.
>
>   systemd.services.foo =
>     { script = "nix-shell -p ...";
>       environment = config.environment.sessionVariables;
>       startAt = "12:34";
>     };

Right :-)

But don't forget that NIX_REMOTE isn't part of
config.environment.sessionVariables. (Should it have been?)

- Bjørn
_______________________________________________
nix-dev mailing list
[email protected]
http://lists.science.uu.nl/mailman/listinfo/nix-dev

Reply via email to