Add a system' parameter to
nixpkgs-derivation'.
* guix/utils.scm (nixpkgs-derivation): Add a `system' parameter. Pass it in the `nix-instantiate' invocation.
This commit is contained in:
parent
b642e4b853
commit
fbc93bedff
1 changed files with 3 additions and 2 deletions
|
@ -460,11 +460,12 @@ (define %nixpkgs-directory
|
||||||
;; Capture the build-time value of $NIXPKGS.
|
;; Capture the build-time value of $NIXPKGS.
|
||||||
(compile-time-value (getenv "NIXPKGS"))))
|
(compile-time-value (getenv "NIXPKGS"))))
|
||||||
|
|
||||||
(define (nixpkgs-derivation attribute)
|
(define* (nixpkgs-derivation attribute #:optional (system (%current-system)))
|
||||||
"Return the derivation path of ATTRIBUTE in Nixpkgs."
|
"Return the derivation path of ATTRIBUTE in Nixpkgs."
|
||||||
(let* ((p (open-pipe* OPEN_READ (or (getenv "NIX_INSTANTIATE")
|
(let* ((p (open-pipe* OPEN_READ (or (getenv "NIX_INSTANTIATE")
|
||||||
"nix-instantiate")
|
"nix-instantiate")
|
||||||
"-A" attribute (%nixpkgs-directory)))
|
"-A" attribute (%nixpkgs-directory)
|
||||||
|
"--argstr" "system" system))
|
||||||
(l (read-line p))
|
(l (read-line p))
|
||||||
(s (close-pipe p)))
|
(s (close-pipe p)))
|
||||||
(and (zero? (status:exit-val s))
|
(and (zero? (status:exit-val s))
|
||||||
|
|
Loading…
Reference in a new issue