help-guix
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Running a shell command with home-run-on-change-service-type


From: Elias Kueny
Subject: Running a shell command with home-run-on-change-service-type
Date: Mon, 19 Dec 2022 18:46:19 +0000

Hello,

I'm trying to extend the home-run-on-change-service-type service to run the fish command 
"fisher update" when the file ~/.config/fish/fish_plugins changed, so that 
fisher plugins are installed or removed by guix home reconfigure.

My service definitions are:

(define-module (modules shells)
  #:use-module (guix gexp)
  #:use-module (gnu packages)
  #:use-module (gnu services)
  #:use-module (gnu home services)
  #:use-module (gnu home services shells))

(define-public fish-services
               (list
                (simple-service 'fisher-update-on-change
                                home-run-on-change-service-type
                                `(("files/.config/fish/fish_plugins"
                                   #~(system* #$(file-append fish "/bin/fish") "-c" 
"fisher update"))))

                (simple-service 'fish-home-xdg-configuration-service
                                home-xdg-configuration-files-service-type
                                `(("fish/fish_plugins"
                                   ,(local-file 
"../config/fish/fish_plugins"))))))

The file change is detected on reconfigure, and then it throws an error: 
ice-9/boot-9.scm:1685:16: In procedure raise-exception: error: gexp: unbound 
variable (full backtrace below).
Could somebody tell me what is wrong with the G-expression? I don't understand 
which variable is unbound.

Backtrace:
In guix/ui.scm:
  2238:10 19 (run-guix-command _ . _)
In ice-9/boot-9.scm:
  1752:10 18 (with-exception-handler _ _ #:unwind? _ # _)
In guix/status.scm:
    835:3 17 (_)
    815:4 16 (call-with-status-report _ _)
In guix/scripts/home.scm:
    513:4 15 (_)
In ice-9/boot-9.scm:
  1752:10 14 (with-exception-handler _ _ #:unwind? _ # _)
In guix/store.scm:
   661:37 13 (thunk)
   1300:8 12 (call-with-build-handler _ _)
   1300:8 11 (call-with-build-handler #<procedure 7f0af683c210 at g…> …)
  2170:25 10 (run-with-store #<store-connection 256.99 7f0af90534b0> …)
In guix/scripts/home.scm:
   447:16  9 (_ _)
In unknown file:
           8 (primitive-load "/gnu/store/x8s6yhdzc79c1yfjwwwi4hq00s4…")
In ice-9/eval.scm:
    619:8  7 (_ #(#(#(#(#(#(#(#(#(#(#<…> …) …) …) …) …) …) …) …) …) …))
    619:8  6 (_ #(#(#(#(#(#(#(#(#(#(#<…> …) …) …) …) …) …) …) …) …) …))
In srfi/srfi-1.scm:
    634:9  5 (for-each #<procedure primitive-eval (exp)> _)
In ice-9/eval.scm:
   191:27  4 (_ #f)
   223:20  3 (proc #<directory (guile-user) 7f0b0f512c80>)
In unknown file:
           2 (%resolve-variable (7 . gexp) #<directory (guile-user) …>)
In ice-9/boot-9.scm:
  1685:16  1 (raise-exception _ #:continuable? _)
  1685:16  0 (raise-exception _ #:continuable? _)

ice-9/boot-9.scm:1685:16: In procedure raise-exception:
error: gexp: unbound variable



reply via email to

[Prev in Thread] Current Thread [Next in Thread]