Claes Wallin (韋嘉誠) at 2016-03-10T10:20:08Z

From Nix 1.11 release notes:
nix-shell can now be used as a #!-interpreter. This allows you to write scripts that dynamically fetch their own dependencies.
Pretty awesome! Here's the template from the manual:

#! /usr/bin/env nix-shell
#! nix-shell -i real-interpreter -p packages

I think the syntax is a bit obscure. I'm sure that when guix environment gets this (because why wouldn't it), it will be pretty intuitive.

Of course, this is all sugar that could already be accomplished with a wrapper like:

#!/bin/bash guix environment --ad-hoc packages -- real-interpreter "$0".real "$@"

But sugar is neat.

lfam likes this.