all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* modular shepherd config
@ 2020-04-09 21:20 Efraim Flashner
  2020-04-10  7:41 ` Pierre Neidhardt
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Efraim Flashner @ 2020-04-09 21:20 UTC (permalink / raw)
  To: guix-devel

[-- Attachment #1: Type: text/plain, Size: 1292 bytes --]

A while ago I split my personal shepherd init.scm into a bunch of files
and I wanted to document it somewhere for others to see also. Any
suggestion where I should put it? Shepherd manual? guix-cookbook?

(ins)efraim@E5400 ~$ tree .config/shepherd/
.config/shepherd/
├── init.d
│   ├── dropbox.scm
│   ├── fccache.scm
│   ├── gnupg.scm
│   ├── guix.scm
│   ├── kdeconnect.scm
│   ├── mbsync.scm
│   ├── syncthing.scm
│   └── vdirsyncer.scm
├── init.scm
└── shepherd.log

(ins)efraim@E5400 ~$ cat .config/shepherd/init.scm
(use-modules (shepherd service)
             ((ice-9 ftw) #:select (scandir)))

;; Load all the files in the directory 'init.d' with a suffix '.scm'.
(for-each
  (lambda (file)
    (load (string-append "init.d/" file)))
  (scandir (string-append (dirname (current-filename)) "/init.d")
           (lambda (file)
             (string-suffix? ".scm" file))))

;; Send shepherd into the background
(action 'shepherd 'daemonize)


-- 
Efraim Flashner   <efraim@flashner.co.il>   אפרים פלשנר
GPG key = A28B F40C 3E55 1372 662D  14F7 41AA E7DC CA3D 8351
Confidentiality cannot be guaranteed on emails sent or received unencrypted

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

* Re: modular shepherd config
  2020-04-09 21:20 modular shepherd config Efraim Flashner
@ 2020-04-10  7:41 ` Pierre Neidhardt
  2020-04-14  4:46 ` Maxim Cournoyer
  2020-04-20  7:44 ` Jan Nieuwenhuizen
  2 siblings, 0 replies; 4+ messages in thread
From: Pierre Neidhardt @ 2020-04-10  7:41 UTC (permalink / raw)
  To: Efraim Flashner, guix-devel

[-- Attachment #1: Type: text/plain, Size: 218 bytes --]

Please do share your config, I'd really like to borrow some of your
services! :)

Mine (nothing very sophisticated):
https://gitlab.com/ambrevar/dotfiles

Cheers!

-- 
Pierre Neidhardt
https://ambrevar.xyz/

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 487 bytes --]

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

* Re: modular shepherd config
  2020-04-09 21:20 modular shepherd config Efraim Flashner
  2020-04-10  7:41 ` Pierre Neidhardt
@ 2020-04-14  4:46 ` Maxim Cournoyer
  2020-04-20  7:44 ` Jan Nieuwenhuizen
  2 siblings, 0 replies; 4+ messages in thread
From: Maxim Cournoyer @ 2020-04-14  4:46 UTC (permalink / raw)
  To: Efraim Flashner; +Cc: guix-devel

Hello Efraim,

Efraim Flashner <efraim@flashner.co.il> writes:

> A while ago I split my personal shepherd init.scm into a bunch of files
> and I wanted to document it somewhere for others to see also. Any
> suggestion where I should put it? Shepherd manual? guix-cookbook?

Since this is purely about organizing Shepherd services (with nothing
specific about Guix), I'd add this to the Shepherd manual; then perhaps
link to it from other places if relevant.

> (ins)efraim@E5400 ~$ tree .config/shepherd/
> .config/shepherd/
> ├── init.d
> │   ├── dropbox.scm
> │   ├── fccache.scm
> │   ├── gnupg.scm
> │   ├── guix.scm
> │   ├── kdeconnect.scm
> │   ├── mbsync.scm
> │   ├── syncthing.scm
> │   └── vdirsyncer.scm
> ├── init.scm
> └── shepherd.log
>
> (ins)efraim@E5400 ~$ cat .config/shepherd/init.scm
> (use-modules (shepherd service)
>              ((ice-9 ftw) #:select (scandir)))
>
> ;; Load all the files in the directory 'init.d' with a suffix '.scm'.
> (for-each
>   (lambda (file)
>     (load (string-append "init.d/" file)))
>   (scandir (string-append (dirname (current-filename)) "/init.d")
>            (lambda (file)
>              (string-suffix? ".scm" file))))
>
> ;; Send shepherd into the background
> (action 'shepherd 'daemonize)

Don't you also need to register the services and arrange to have them
started?

My init.scm looks like:

--8<---------------cut here---------------start------------->8---
;;; Shepherd User Services
(load "services.scm")

(register-services
 emacs
 gpg-agent
 jackd
 ibus-daemon
 workrave)

;; Send shepherd into the background.
(action 'shepherd 'daemonize)

;; Services to start when shepherd starts:
(for-each start '(emacs
		  gpg-agent
		  ibus-daemon
		  workrave))
--8<---------------cut here---------------end--------------->8---

Thanks for sharing!

Maxim

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

* Re: modular shepherd config
  2020-04-09 21:20 modular shepherd config Efraim Flashner
  2020-04-10  7:41 ` Pierre Neidhardt
  2020-04-14  4:46 ` Maxim Cournoyer
@ 2020-04-20  7:44 ` Jan Nieuwenhuizen
  2 siblings, 0 replies; 4+ messages in thread
From: Jan Nieuwenhuizen @ 2020-04-20  7:44 UTC (permalink / raw)
  To: Efraim Flashner; +Cc: guix-devel

Efraim Flashner writes:

> A while ago I split my personal shepherd init.scm into a bunch of files
> and I wanted to document it somewhere for others to see also. Any
> suggestion where I should put it? Shepherd manual? guix-cookbook?

This looks interesting, so how to get started trying?  My most pressing
question is: how and when do you start your user's shepherd?

Do I have to log into the machine, do I have to stay logged-in?

Greetings,
janneke

-- 
Jan Nieuwenhuizen <janneke@gnu.org> | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com | Avatar® http://AvatarAcademy.com

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

end of thread, other threads:[~2020-04-20  7:44 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-04-09 21:20 modular shepherd config Efraim Flashner
2020-04-10  7:41 ` Pierre Neidhardt
2020-04-14  4:46 ` Maxim Cournoyer
2020-04-20  7:44 ` Jan Nieuwenhuizen

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.