unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Christopher Allan Webber <cwebber@dustycloud.org>
To: "Ludovic Courtès" <ludo@gnu.org>
Cc: guix-devel@gnu.org
Subject: Re: GHM debriefing
Date: Mon, 29 Aug 2016 10:20:59 -0500	[thread overview]
Message-ID: <87a8fv8uuc.fsf@dustycloud.org> (raw)
In-Reply-To: <87eg5769n9.fsf@gnu.org>

All good news!  One comment:

Ludovic Courtès writes:

> For the last talk, I rehashed the basics since the audience wasn’t too
> familiar I suppose, and then wrote a GuixSD service for OpenSSH’s ‘sshd’
> (attached).  Hopefully a useful starting point and tutorial.

It looks like a good tutorial in its simplicity!  Maybe it could be
added as an "example" section at the end of the Defining Services
chapter?

You might have also seen that, as a non-tutorial, Julien Lepiller has
been working on getting an openssh-service into GuixSD.  It might be
good for someone to look if there are any overlaps or things that should
be joined between both definitions, as in terms of getting it really
into Guix :)

(Unfortunately, I'm still in crunchmode, so I'm not volunteering
myself!)

 - Chris

> That’s it!
>
> Ludo’.
>
> (define-module (gnu services openssh)
>   #:use-module (gnu)
>   #:use-module (gnu services shepherd)
>   #:use-module (gnu packages ssh)
>   #:use-module (guix)
>   #:export (openssh-service-type))
>
> (define (ssh-shepherd-service config-file)
>   (list (shepherd-service
>          (provision '(ssh-daemon))
>          (requirement '(networking))
>          (start #~(make-forkexec-constructor
>                    (list (string-append #$openssh "/sbin/sshd")
>                          "-f" #$config-file)
>                    #:pid-file "/etc/sshd.pid"))
>          (stop #~(make-kill-destructor)))))
>
> (define %sshd-accounts
>   (list (user-account
>          (name "sshd")
>          (comment "OpenSSH privilege separation user")
>          (home-directory "/var/empty")
>          (system? #t)
>          (group "nogroup"))))
>
> (define %sshd-keygen
>   #~(system* (string-append #$openssh "/bin/ssh-keygen")
>              "-t" "ed25519" "-N" "" "-f"
>              "/etc/ssh_host_ed25519_key"))
>
> (define openssh-service-type
>   (service-type
>    (name 'openssh)
>    (extensions (list (service-extension shepherd-root-service-type
>                                         ssh-shepherd-service)
>                      (service-extension account-service-type
>                                         (const %sshd-accounts))
>                      (service-extension activation-service-type
>                                         (const %sshd-keygen))))))

  parent reply	other threads:[~2016-08-29 15:21 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-28 22:09 GHM debriefing Ludovic Courtès
2016-08-29 12:48 ` David Craven
2016-08-29 13:50 ` Vincent Legoll
2016-08-29 15:20 ` Christopher Allan Webber [this message]
2016-08-30 15:57   ` Ludovic Courtès
2016-08-31 13:40 ` ng0
2016-08-31 13:48   ` David Craven
2016-08-31 22:28 ` Clément Lassieur
2016-08-31 23:08   ` Leo Famulari
2016-09-01  6:41   ` ng0
2016-09-01 12:24   ` Ludovic Courtès
2016-09-03  8:05   ` Hartmut Goebel
  -- strict thread matches above, loose matches on Subject: below --
2013-08-29 21:52 Ludovic Courtès

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87a8fv8uuc.fsf@dustycloud.org \
    --to=cwebber@dustycloud.org \
    --cc=guix-devel@gnu.org \
    --cc=ludo@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).