[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Running a shell command with home-run-on-change-service-type
From: |
Jelle Licht |
Subject: |
Re: Running a shell command with home-run-on-change-service-type |
Date: |
Tue, 20 Dec 2022 11:12:51 +0100 |
Elias Kueny <elias.kueny@posteo.net> writes:
Hello Elias!
Buyer beware; I am not a G-expression guru. Having said that...
> 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"))))
... here you quasi-quote the service extension configuration with
"`". To make use of a gexp in the expression, we need to unquote the gexp
expression, so replace "#~" by ",#~".
HTH and gets you unstuck!
- Jelle