From: "Thompson, David" <dthompson2@worcester.edu>
To: "Ludovic Courtès" <ludo@gnu.org>
Cc: guix-devel <guix-devel@gnu.org>
Subject: Re: [PATCH] gnu: services: Add nginx-service.
Date: Thu, 27 Aug 2015 22:12:18 -0400 [thread overview]
Message-ID: <CAJ=Rwfafz7aAtm28b7VXoAMGONpyg9MTae6WX9Mpyen_djFsKQ@mail.gmail.com> (raw)
In-Reply-To: <876143f3v4.fsf@gnu.org>
On Tue, Aug 25, 2015 at 5:35 PM, Ludovic Courtès <ludo@gnu.org> wrote:
> "Thompson, David" <dthompson2@worcester.edu> skribis:
>
>> On Tue, Aug 18, 2015 at 11:58 AM, Ludovic Courtès <ludo@gnu.org> wrote:
>>> "Thompson, David" <dthompson2@worcester.edu> skribis:
>>>
>>>> From c2da6c04eb1a12d0ee2f56a3954673f3bddc122b Mon Sep 17 00:00:00 2001
>>>> From: David Thompson <dthompson2@worcester.edu>
>>>> Date: Sun, 2 Aug 2015 23:29:53 -0400
>>>> Subject: [PATCH] gnu: services: Add nginx-service.
>>>>
>>>> * gnu/services/web.scm: New file.
>>>> * gnu-system.am (GNU_SYSTEM_MODULES): Add it.
>>>
>>> [...]
>>>
>>>> +(define (default-nginx-config log-directory run-directory)
>>>> + (text-file* "nginx.conf"
>>>> + "user nginx nginx;\n"
>>>> + "pid " run-directory "/pid;\n"
>>>> + "error_log " log-directory "/error.log info;\n"
>>>> + "http {\n"
>>>> + " access_log " log-directory "/access.log;\n"
>>>> + " root /var/www;\n"
>>>> + " server {}\n"
>>>> + "}\n"
>>>> + "events {}\n"))
>>>> +
>>>> +(define* (nginx-service #:key (nginx nginx)
>>>> + (log-directory "/var/log/nginx")
>>>> + (run-directory "/var/run/nginx")
>>>> + (config-file
>>>> + (default-nginx-config log-directory run-directory)))
>>>
>>> There’s this annoying thing that here ‘config-file’ is a monadic value
>>> when we’d instead prefer a “file-like object.”
>
> But it just occurred to me that you could write:
>
> (define (default-nginx-config log-directory run-directory)
> (plain-file "nginx.conf"
> (string-append ...)))
>
> Problem solved!
Good idea, thanks! I made this change, added a new section to the
docs, and pushed.
- Dave
prev parent reply other threads:[~2015-08-28 2:12 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-08-03 3:31 [PATCH] gnu: services: Add nginx-service David Thompson
2015-08-04 1:48 ` Thompson, David
2015-08-18 15:58 ` Ludovic Courtès
2015-08-19 0:23 ` Thompson, David
2015-08-25 21:35 ` Ludovic Courtès
2015-08-28 2:12 ` Thompson, David [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='CAJ=Rwfafz7aAtm28b7VXoAMGONpyg9MTae6WX9Mpyen_djFsKQ@mail.gmail.com' \
--to=dthompson2@worcester.edu \
--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).