[Nix-dev] /usr/bin/env ?

Marc Weber marco-oweber at gmx.de
Mon Jan 18 14:46:55 CET 2010


If you want to collaborate with other Linux users you have to think
about how to share scritps. Currently this can't be done on NixOS
because the only script type which is supported by NixOS is /bin/sh.

So even if you want to use bash features you're in trouble:

You cat just use /bin/sh and hope it works. However this will break on
other systems.

There is already a solution: using the env executable.

#! /usr/bin/env bash

works everywhere except NixOS.

So why don't we just add this symlink by default? It is as pure as your
PATH env var. So I don't see any disadvantages.

Does someone mind me adding this line to the activation script?

mkdir -p /urs/bin; ln -s /var/run/current-system/sw/bin/env /usr/bin/env

Marc Weber



More information about the nix-dev mailing list