all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Guix Home, .local/bin executable scripts
@ 2022-09-24 20:06 Fabio Natali
  2022-09-24 22:49 ` Trev
  0 siblings, 1 reply; 3+ messages in thread
From: Fabio Natali @ 2022-09-24 20:06 UTC (permalink / raw)
  To: help-guix

Dear All,

I've recently started exploring Guix Home. I was able to create a few
simple services for some of my apps, e.g. Emacs.

I've now come to a point where I'd like to add some executables to my
configuration, e.g. some of my `.local/bin' scripts.

Consider this `hello.sh' script, for example:

,----
| #!/bin/bash
| 
| echo "Hello World" | sed "s/World/Guix/"
`----

The following service copies `hello.sh' to the expected destination and
does so while preserving the correct permissions (`#:recursive #t'),
i.e. the file is executable.

,----
| (define my/home-hello-service
|   (service
|    (service-type
|     (name 'home-hello)
|     (extensions
|      (list
|       (service-extension
|        home-files-service-type
|        (lambda (config)
|          `((".local/bin/hello.sh"
|             ,(local-file "scripts/hello.sh" #:recursive? #t)))))))
|     (default-value #f)
|     (description "My valuable Hello World script."))))
`----

The script shows up in my Guix Home but it won't work - I suppose that
`/bin/bash' should be replaced with the correct Bash store path?

,----
| ~$ hello.sh
| -bash: ~/.local/bin/hello.sh: /bin/bash: bad interpreter: No such file or directory
`----

I've been looking at the docs and found something that feels related to
my problem (e.g. `computed-file', `substitute*', ...?) but I'd
appreciate if someone could point me in the right direction.

Thanks, best, Fabio.


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

end of thread, other threads:[~2022-09-25 13:27 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-09-24 20:06 Guix Home, .local/bin executable scripts Fabio Natali
2022-09-24 22:49 ` Trev
2022-09-25 13:27   ` Fabio Natali

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.