[Nix-dev] Suggestion: programs are *always* in the path

Bjørn Forsman bjorn.forsman at gmail.com
Mon May 1 12:12:17 CEST 2017

On 1 May 2017 at 12:05, Eelco Dolstra <eelco.dolstra at logicblox.com> wrote:
> Hi,
> On 05/01/2017 11:55 AM, regivanx at gmail.com wrote:
>> If you enter a command, you want to run it.
>> If the corresponding program is not installed, the command is a symbolic link to
>> a script that says:
>> _ download the program and its dependencies,
>> _ install it,
>> _ run it.
> On NixOS, you can already do something like that by setting $NIX_AUTO_RUN to 1.
> E.g.
> $ export NIX_AUTO_RUN=1

Follow up:

NIX_AUTO_RUN=1 means the program will be run via nix-shell. (The
grabage collector may remove it on the next GC run.)

NIX_AUTO_INSTALL=1 means the program will be installed with nix-env
and then run from your normal shell. (It won't be automatically
garbage collected.)

Best regards,
Bjørn Forsman

More information about the nix-dev mailing list