Hi,

On 08/10/15 09:23, Bjørn Forsman wrote:

> On 8 October 2015 at 09:18, Domen Kožar <do...@dev.si> 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";
    };

-- 
Eelco Dolstra | LogicBlox, Inc. | http://nixos.org/~eelco/
_______________________________________________
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev

Reply via email to