all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Adding %conf-dir breaks module
@ 2023-07-29  2:54 jgart
  2023-07-29  2:57 ` jgart
  2023-07-30 22:02 ` Attila Lendvai
  0 siblings, 2 replies; 3+ messages in thread
From: jgart @ 2023-07-29  2:54 UTC (permalink / raw)
  To: guix-devel

Hi,

Adding the following %conf-dir expression breaks this entire module. If I comment it out all is fine.

(define-module (confetti features common-lisp)
  #:use-module (rde features)
  #:use-module (rde features emacs)
  #:use-module (rde features predicates)
  #:use-module (guixrus packages guix)
  #:use-module (guixrus packages common lisp)
  #:use-module (gnu home services)
  #:use-module (gnu packages emacs-xyz)
  #:use-module (gnu packages lisp)
  #:use-module (gnu packages lisp-xyz)
  #:use-module (gnu services)
  #:use-module (guix gexp)
  #:use-module (guix packages)
  #:export (feature-common-lisp))

;; Adding the following %conf-dir expression breaks this entire module. If I comment it out all is fine.
(define %conf-dir
  (dirname (current-filename)))

;; (define (path-join . args)
;;   (string-join args "/"))

;; (define (config-file file)
;;   (local-file (path-join %conf-dir file)))

(define* (feature-common-lisp
          #:key
          (lisp-implementation sbcl)
          (init-file "lisp/sbclrc.lisp"))
  "Configure Common Lisp support."
  (ensure-pred file-like? lisp-implementation)

  ;; TODO: Use path like or whatnot.
  (ensure-pred string? init-file)

  (feature
   (name 'common-lisp)
   (home-services-getter
    (lambda (config)
      (list
       (simple-service 'add-guixrus-home-packages home-profile-service-type
                       (list sbcl-cl-guix-utils guixrus-scripts sbcl-slynk sbcl))
       (simple-service 'add-rus-shell-home-envs home-environment-variables-service-type
                       '(("GUIX_EXTENSIONS_PATH" . "$HOME/.guix-home/profile/share/guix/extensions")))
         (simple-service 'add-sbclrc-home-file home-files-service-type
                       (list `(".sbclrc" ,(local-file init-file)))))))))

Any thoughts on why that would happen?

https://git.sr.ht/~whereiseveryone/confetti/tree/590f999c0b836059232314b2b240ef1561ef9a83/conf/confetti/features/common-lisp.scm#L38


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Adding %conf-dir breaks module
  2023-07-29  2:54 Adding %conf-dir breaks module jgart
@ 2023-07-29  2:57 ` jgart
  2023-07-30 22:02 ` Attila Lendvai
  1 sibling, 0 replies; 3+ messages in thread
From: jgart @ 2023-07-29  2:57 UTC (permalink / raw)
  To: guix-devel

(define-module (confetti features common-lisp)
  #:use-module (rde features)
  #:use-module (rde features emacs)
  #:use-module (rde features predicates)
  #:use-module (confetti srfi srfi-197)
  #:use-module (guixrus packages guix)
  #:use-module (guixrus packages common lisp)
  #:use-module (gnu home services)
  #:use-module (gnu packages emacs-xyz)
  #:use-module (gnu packages lisp)
  #:use-module (gnu packages lisp-xyz)
  #:use-module (gnu services)
  #:use-module (guix gexp)
  #:use-module (guix packages)
  #:export (feature-common-lisp))

;; This is OK.
(define x 3)

;; But this is not OK. How come?
(define %conf-dir
  (dirname (current-filename)))

;; (define (path-join . args)
;;   (string-join args "/"))

;; (define (config-file file)
;;   (local-file (path-join %conf-dir file)))

(define* (feature-common-lisp
          #:key
          (lisp-implementation sbcl)
          (init-file "lisp/sbclrc.lisp"))
  "Configure Common Lisp support."
  (ensure-pred file-like? lisp-implementation)

  ;; TODO: Use path like or whatnot.
  (ensure-pred string? init-file)

  (feature
   (name 'common-lisp)
   (home-services-getter
    (lambda (config)
      (list
       (simple-service 'add-guixrus-home-packages home-profile-service-type
                       (list sbcl-cl-guix-utils guixrus-scripts sbcl-slynk sbcl))
       (simple-service 'add-rus-shell-home-envs home-environment-variables-service-type
                       '(("GUIX_EXTENSIONS_PATH" . "$HOME/.guix-home/profile/share/guix/extensions")))
         (simple-service 'add-sbclrc-home-file home-files-service-type
                       (list `(".sbclrc" ,(local-file init-file)))))))))


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Adding %conf-dir breaks module
  2023-07-29  2:54 Adding %conf-dir breaks module jgart
  2023-07-29  2:57 ` jgart
@ 2023-07-30 22:02 ` Attila Lendvai
  1 sibling, 0 replies; 3+ messages in thread
From: Attila Lendvai @ 2023-07-30 22:02 UTC (permalink / raw)
  To: jgart; +Cc: guix-devel

> Any thoughts on why that would happen?

not sure whether this is related, but:

https://issues.guix.gnu.org/55464

i.e. current-filename does some syntax-time magic. one effect of that is that it behaves differently when guix pull'ing the code (as opposed to running it in Geiser).

-- 
• attila lendvai
• PGP: 963F 5D5F 45C7 DFCD 0A39
--
You can do everything with bayonets except sit on them.



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-07-30 22:03 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-07-29  2:54 Adding %conf-dir breaks module jgart
2023-07-29  2:57 ` jgart
2023-07-30 22:02 ` Attila Lendvai

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.