~abcdw/rde-devel

rde: rde: Add feature-guix-extensions v1 NEEDS REVISION

Nicolas Graves: 1
 rde: Add feature-guix-extensions

 1 files changed, 34 insertions(+), 0 deletions(-)
#1403182 .build.yml success
This patch should be REVISED or REJECTED depending on the status of
upstream issues 74425 and 74633.
Export patchset (mbox)
How do I use this?

Copy & paste the following snippet into your terminal to import this patchset into git:

curl -s https://lists.sr.ht/~abcdw/rde-devel/patches/56774/mbox | git am -3
Learn more about email & git

[PATCH rde] rde: Add feature-guix-extensions Export this patch

---
 src/rde/features/base.scm | 34 ++++++++++++++++++++++++++++++++++
 1 file changed, 34 insertions(+)

diff --git a/src/rde/features/base.scm b/src/rde/features/base.scm
index 185b4f9f..b434ad90 100644
--- a/src/rde/features/base.scm
+++ b/src/rde/features/base.scm
@@ -1,6 +1,7 @@
;;; rde --- Reproducible development environment.
;;;
;;; Copyright © 2021, 2022, 2023, 2024 Andrew Tropin <andrew@trop.in>
;;; Copyright © 2024 Nicolas Graves <ngraves@ngraves.fr>
;;;
;;; This file is part of rde.
;;;
@@ -62,6 +63,7 @@
            feature-hidpi
            feature-generic
            feature-foreign-distro
            feature-guix-extensions

            %rde-default-substitute-urls
            %rde-default-authorized-guix-keys))
@@ -398,3 +400,35 @@ HiDPI friendly."
   (values `((foreign-distro . #t)
             (glibc-locales . ,glibc-locales)
             (nss-certs . ,nss-certs)))))


(define* (feature-guix-extensions
          #:key
          (extension-packages '()))
  "Guix extensions are not very convenient to use out-of-the-box.  The Guix
package has a native-search-path with GUIX_EXTENSIONS_PATH, but Guix itself is
typically not installed in a profile, so installing a guix extension in a
profile is not enough to make it usable.  This feature adds EXTENSION-PACKAGES
to the profile, and sets this GUIX_EXTENSIONS_PATH accordingly."
  (ensure-pred list-of-file-likes? extension-packages)

  (define (get-home-services _)
    (list
     (simple-service
      'guix-extensions-packages
      home-profile-service-type
      extension-packages)
     (simple-service
      'guix-extensions-path-environment-variable
      home-environment-variables-service-type
      `(("GUIX_EXTENSIONS_PATH"
         . ,#~(string-join
               (map (lambda (out)
                      (string-append out "/share/guix/extensions"))
                    (list #$@extension-packages))
               ":"))))))

  (feature
   (name 'guix-extensions)
   (home-services-getter get-home-services)
   (values `((guix-extensions . #t)))))
-- 
2.47.1
rde/patches/.build.yml: SUCCESS in 3m34s

[rde: Add feature-guix-extensions][0] from [Nicolas Graves][1]

[0]: https://lists.sr.ht/~abcdw/rde-devel/patches/56774
[1]: mailto:ngraves@ngraves.fr

✓ #1403182 SUCCESS rde/patches/.build.yml https://builds.sr.ht/~abcdw/job/1403182