1
0
mirror of https://git.savannah.gnu.org/git/guix.git synced 2026-05-26 19:11:46 +02:00

gexp: Add 'references-file'.

* gnu/services/base.scm (references-file): Remove.
* guix/gexp.scm (references-file): New procedure.
* tests/gexp.scm ("references-file"): New test.
This commit is contained in:
Ludovic Courtès
2022-04-13 19:59:03 +02:00
parent 6b4124cdcc
commit 774f8804ba
3 changed files with 62 additions and 22 deletions
-22
View File
@@ -219,8 +219,6 @@
pam-limits-service-type
pam-limits-service
references-file
%base-services))
;;; Commentary:
@@ -1768,26 +1766,6 @@ proxy of 'guix-daemon'...~%")
(substitute-key-authorization authorized-keys guix)
#~#f))))
(define* (references-file item #:optional (name "references"))
"Return a file that contains the list of references of ITEM."
(if (struct? item) ;lowerable object
(computed-file name
(with-extensions (list guile-gcrypt) ;for store-copy
(with-imported-modules (source-module-closure
'((guix build store-copy)))
#~(begin
(use-modules (guix build store-copy))
(call-with-output-file #$output
(lambda (port)
(write (map store-info-item
(call-with-input-file "graph"
read-reference-graph))
port))))))
#:options `(#:local-build? #f
#:references-graphs (("graph" ,item))))
(plain-file name "()")))
(define guix-service-type
(service-type
(name 'guix)