Hello, I'm trying to use the `home-state-service-type' in my home
config, but it is not working for me. When I try to init the state I get
the following error:
--8<---------------cut here---------------start------------->8---
Initializing state-/home/lars/stumpwm.
herd: error: exception caught while executing 'unchecked-init' on service 'state-/home/lars/stumpwm':
In procedure module-lookup: Unbound variable: open-pipe-with-stderr
--8<---------------cut here---------------end--------------->8---
I saw another thread on the list with this exact same error from last
year with no resolution yet. Is `home-state-service-type` abandoned/not
working?
This is the relevant part of my home config:
--8<---------------cut here---------------start------------->8---
(service home-state-service-type
(list (state-git "/home/lars/stumpwm"
"https://github.com/stumpwm/stumpwm")))
--8<---------------cut here---------------end--------------->8---
Which is, as far as I can tell, exactly how it is done in your video.
On 2023-12-07 09:24, rustand lars wrote:
> Hello, I'm trying to use the `home-state-service-type' in my home> config, but it is not working for me. When I try to init the state I get> the following error:>> --8<---------------cut here---------------start------------->8---> Initializing state-/home/lars/stumpwm.> herd: error: exception caught while executing 'unchecked-init' on service 'state-/home/lars/stumpwm':> In procedure module-lookup: Unbound variable: open-pipe-with-stderr> --8<---------------cut here---------------end--------------->8--->> I saw another thread on the list with this exact same error from last> year with no resolution yet. Is `home-state-service-type` abandoned/not> working?>> This is the relevant part of my home config:>> --8<---------------cut here---------------start------------->8---> (service home-state-service-type> (list (state-git "/home/lars/stumpwm"> "https://github.com/stumpwm/stumpwm")))> --8<---------------cut here---------------end--------------->8--->> Which is, as far as I can tell, exactly how it is done in your video.
Hello Lars!
I didn't touch this code for a long time and have long standing plan to
refactor or rewrite it. I was busy with Arei (Guile Scheme IDE) and a
few more other things lately, but I regulary think and write some
related notes and snippets in local draft of (rde state), this question
also often bothers me, so I will get to it ASAP, but not earlier :)
I don't recommend to use "home-services" version of
home-state-service-type, but you can try to fix it if you want, the
solution probably is to add a module (guix build utils) to init gexp.
Don't hesitate to ping me from time to time on IRC or here about state
managment and related questions.
--
Best regards,
Andrew Tropin
Andrew Tropin <andrew@trop.in> writes:
> I don't recommend to use "home-services" version of> home-state-service-type,
Is there another way I could use it? I have seen that there is something
called a `feature` in rde, but I'm not really using the full rde, I just
have a regular Guix setup with rde added as a channel (for now I only
added it to use the state service).
> but you can try to fix it if you want, the> solution probably is to add a module (guix build utils) to init gexp.
I already tried that, but it didn't help. I added a
`with-imported-modules` around the gexp, and added a `use-modules`
inside it but I still get the same error (which is very strange I think).
> Don't hesitate to ping me from time to time on IRC or here about state> managment and related questions.
Thanks, will do!
On 2023-12-08 10:58, Lars Rustand wrote:
> Andrew Tropin <andrew@trop.in> writes:>>> I don't recommend to use "home-services" version of>> home-state-service-type,>> Is there another way I could use it? I have seen that there is something> called a `feature` in rde, but I'm not really using the full rde, I just> have a regular Guix setup with rde added as a channel (for now I only> added it to use the state service).
The other version of state home service is not implemented yet, so no,
not at the moment :)
>> but you can try to fix it if you want, the>> solution probably is to add a module (guix build utils) to init gexp.>> I already tried that, but it didn't help. I added a> `with-imported-modules` around the gexp, and added a `use-modules`> inside it but I still get the same error (which is very strange I think).>>> Don't hesitate to ping me from time to time on IRC or here about state>> managment and related questions.>> Thanks, will do!>
--
Best regards,
Andrew Tropin
Andrew Tropin <andrew@trop.in> writes:
> Don't hesitate to ping me from time to time on IRC or here about state> managment and related questions.
You've probably not had any time to look at this yet, but I thought I'd
give you a little ping to check just in case.
In the meantime I made a quick and dirty replacement for the service
which has done the job adequately for me for now. Posting it here in
case it could be useful for others:
(define (clone lst)
(with-imported-modules '((guix build utils))
#~(begin
(use-modules (guix build utils))
(for-each (lambda (it)
(let ((url (car it))
(target (string-append #$(getenv "HOME") "/"
(cadr it))))
(mkdir-p target)
(system* #$(file-append git "/bin/git") "clone" url target)))
'#$lst))))
(define-public home-git-clone-service-type
(service-type
(name 'git-clone)
(extensions
(list (service-extension home-activation-service-type
clone)))
(default-value '(()))
(description
"")))
On 2024-01-19 14:23, Lars Rustand wrote:
> Andrew Tropin <andrew@trop.in> writes:>>> Don't hesitate to ping me from time to time on IRC or here about state>> managment and related questions.>> You've probably not had any time to look at this yet, but I thought I'd> give you a little ping to check just in case.>> In the meantime I made a quick and dirty replacement for the service> which has done the job adequately for me for now. Posting it here in> case it could be useful for others:>>> (define (clone lst)> (with-imported-modules '((guix build utils))> #~(begin> (use-modules (guix build utils))> (for-each (lambda (it)> (let ((url (car it))> (target (string-append #$(getenv "HOME") "/"> (cadr it))))>> (mkdir-p target)> (system* #$(file-append git "/bin/git") "clone" url target)))> '#$lst))))>> (define-public home-git-clone-service-type> (service-type> (name 'git-clone)> (extensions> (list (service-extension home-activation-service-type> clone)))> (default-value '(()))> (description> "")))>
Thank you for updates! I have a couple projects, which would benifit
from state management, however still have not enough resources to
properly design and implement it :)
--
Best regards,
Andrew Tropin