unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: ludo@gnu.org (Ludovic Courtès)
To: David Thompson <dthompson2@worcester.edu>
Cc: guix-devel@gnu.org
Subject: Re: [PATCH] services: Add transmission-service.
Date: Sat, 28 Nov 2015 15:07:25 +0100	[thread overview]
Message-ID: <87two6usiq.fsf@gnu.org> (raw)
In-Reply-To: <87vb8mj3pq.fsf@izanagi.i-did-not-set--mail-host-address--so-tickle-me> (David Thompson's message of "Fri, 27 Nov 2015 20:46:25 -0500")

David Thompson <dthompson2@worcester.edu> skribis:

> My first service since the big service API rewrite.  How did I do?

I’d give you an A.  ;-)

> From 6f483d37bf157ee0d253d2aaa919d6900d23453c Mon Sep 17 00:00:00 2001
> From: David Thompson <dthompson2@worcester.edu>
> Date: Fri, 27 Nov 2015 20:40:59 -0500
> Subject: [PATCH] services: Add transmission-service.
>
> * gnu/services/bittorrent.scm: New file.
> * gnu-system.am (GNU_SYSTEM_MODULES): Add it.
> * doc/guix.texi ("BitTorrent Services"): Document it.

[...]

> +@deffn {Scheme Procedure} transmission-service [#:transmission transmission] @
                                                                  ^^^
@var{transmission}

> +       [#:download-directory ``/var/lib/transmission/downloads'']

Use straight quotes here because this is code.

> +(define (transmission-activation config)
> +  (let ((download-dir (transmission-configuration-download-directory config)))
> +    #~(begin
> +        (use-modules (guix build utils))
> +
> +        (display "creating transmission state directory\n")
> +        (mkdir-p #$%transmission-state-directory)
> +        (format #t "creating transmission download directory '~a'~%"
> +                #$download-dir)
> +        (mkdir-p #$download-dir))))

Should it be chown’d to “transmission”?  Maybe the daemon takes care of this?

> +(define* (transmission-service #:key (transmission transmission)
> +                               (port 9091) (peer-port 51413)
> +                               (download-directory
> +                                (string-append %transmission-state-directory
> +                                               "/downloads")))
> +  "Return a service that runs TRANSMISSION, a daemon that downloads and shares
> +files via the BitTorrent protocol.
> +
> +The daemon will serve the web user interface over PORT, handle BitTorrent
> +tasks over PEER-PORT, and save downloaded files to DOWNLOAD-DIRECTORY."

You can use the same Texi string as in the manual here.

Otherwise LGTM!

Thanks,
Ludo’.

      reply	other threads:[~2015-11-28 14:07 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-28  1:46 [PATCH] services: Add transmission-service David Thompson
2015-11-28 14:07 ` Ludovic Courtès [this message]

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=87two6usiq.fsf@gnu.org \
    --to=ludo@gnu.org \
    --cc=dthompson2@worcester.edu \
    --cc=guix-devel@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).