[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] services: Add transmission-service.
From: |
Ludovic Courtès |
Subject: |
Re: [PATCH] services: Add transmission-service. |
Date: |
Sat, 28 Nov 2015 15:07:25 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) |
David Thompson <address@hidden> 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 <address@hidden>
> 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.
[...]
> address@hidden {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’.