Skip to content
Snippets Groups Projects
Commit a09ec3a5 authored by Ludovic Courtès's avatar Ludovic Courtès
Browse files

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>.
parent 83667645
No related branches found
No related tags found
No related merge requests found
...@@ -156,7 +156,15 @@ (define sha256 ...@@ -156,7 +156,15 @@ (define sha256
(define %nixpkgs-directory (define %nixpkgs-directory
(make-parameter (make-parameter
;; Capture the build-time value of $NIXPKGS. ;; 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))) (define* (nixpkgs-derivation attribute #:optional (system (%current-system)))
"Return the derivation path of ATTRIBUTE in Nixpkgs." "Return the derivation path of ATTRIBUTE in Nixpkgs."
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment