diff options
author | Mark H Weaver <mhw@netris.org> | 2015-10-07 23:55:17 -0400 |
---|---|---|
committer | Mark H Weaver <mhw@netris.org> | 2015-10-07 23:55:17 -0400 |
commit | 319fe79dd01e03c4ef61311c336bcd77e1133f02 (patch) | |
tree | c169d85b429a801fdc22ce27c25b7e4230eb320a /guix/utils.scm | |
parent | 9511de1ef8c59788f2c93ae6b0cb1e87e30824ab (diff) | |
parent | a606ed89d4e3737beec2f3392bedba61904778f4 (diff) |
Merge branch 'master' into core-updates
Diffstat (limited to 'guix/utils.scm')
-rw-r--r-- | guix/utils.scm | 38 |
1 files changed, 0 insertions, 38 deletions
diff --git a/guix/utils.scm b/guix/utils.scm index b6df5d9cc9..1d4b2ff9b0 100644 --- a/guix/utils.scm +++ b/guix/utils.scm @@ -44,10 +44,6 @@ #:export (bytevector->base16-string base16-string->bytevector - %nixpkgs-directory - nixpkgs-derivation - nixpkgs-derivation* - compile-time-value fcntl-flock memoize @@ -316,40 +312,6 @@ a list of command-line arguments passed to the compression program." ;;; -;;; Nixpkgs. -;;; - -(define %nixpkgs-directory - (make-parameter - ;; Capture the build-time value of $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." - (let* ((p (open-pipe* OPEN_READ (or (getenv "NIX_INSTANTIATE") - %nix-instantiate) - "-A" attribute (%nixpkgs-directory) - "--argstr" "system" system)) - (l (read-line p)) - (s (close-pipe p))) - (and (zero? (status:exit-val s)) - (not (eof-object? l)) - l))) - -(define-syntax-rule (nixpkgs-derivation* attribute) - "Evaluate the given Nixpkgs derivation at compile-time." - (compile-time-value (nixpkgs-derivation attribute))) - - -;;; ;;; Advisory file locking. ;;; |