diff options
author | Ludovic Courtès <ludo@gnu.org> | 2012-12-10 22:53:28 +0100 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2012-12-10 22:53:28 +0100 |
commit | a09ec3a5af3eb38b31d4eff0f323a2c47b82c114 (patch) | |
tree | 6504af412b5b10a920f9b3a0acdb8d8c3ace048b | |
parent | 836676450dbfc14e675a68889ac5f3d5ab8cebfa (diff) | |
download | patches-a09ec3a5af3eb38b31d4eff0f323a2c47b82c114.tar patches-a09ec3a5af3eb38b31d4eff0f323a2c47b82c114.tar.gz |
Have `%nixpkgs-directory' default to #f when $NIXPKGS is the empty string.
* guix/utils.scm (%nixpkgs-directory): Set to #f when the `NIXPKGS'
environment variable is set but empty. Reported by
Andreas Enge <andreas@enge.fr>.
-rw-r--r-- | guix/utils.scm | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/guix/utils.scm b/guix/utils.scm index 5ec8f3736d..453b3843dd 100644 --- a/guix/utils.scm +++ b/guix/utils.scm @@ -156,7 +156,15 @@ evaluate to a simple datum." (define %nixpkgs-directory (make-parameter ;; Capture the build-time value of $NIXPKGS. - (or %nixpkgs (getenv "NIXPKGS")))) + (or %nixpkgs + (and=> (getenv "NIXPKGS") + (lambda (val) + ;; Bail out when passed an empty string, otherwise + ;; `nix-instantiate' will sit there and attempt to read + ;; from its standard input. + (if (string=? val "") + #f + val)))))) (define* (nixpkgs-derivation attribute #:optional (system (%current-system))) "Return the derivation path of ATTRIBUTE in Nixpkgs." |