[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Question about scripts in guix-home
From: |
Fredrik Salomonsson |
Subject: |
Re: Question about scripts in guix-home |
Date: |
Sun, 17 Oct 2021 18:45:19 +0000 |
Oleg Pykhalov <go.wigust@gmail.com> writes:
> Well, if you don't want to put the content of
> files/waybar/modules-mic.sh file inside a Scheme string, then you need
> to read the file to a string, e.g.:
> --8<---------------cut here---------------start------------->8---
> (simple-service 'shellcheck-wrapper
> home-files-service-type
> (list `("local/bin/shellcheck"
> ,(computed-file
> "shellcheck-wrapper"
> #~(begin
> (use-modules (ice-9 rdelim))
> (with-output-to-file #$output
> (lambda ()
> (display #$(with-input-from-file
> "/tmp/foo" read-string))))
> (chmod #$output #o555))))))
> --8<---------------cut here---------------end--------------->8---
I'm a bit confused, "Scheme string" and string aren't they the same
thing?
> Note that it's just an example which you should change according to your
> needs. ;-) Also, it creates not an executable but a symlink to an
> executable in a store, which I missed in a previous answer.
Thank you for the example! This looks like what I was looking for.
--
s/Fred[re]+i[ck]+/Fredrik/g