unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Alex Kost <alezost@gmail.com>
To: "Ludovic Courtès" <ludo@gnu.org>
Cc: guix-devel@gnu.org
Subject: Re: Customizing /etc
Date: Tue, 20 Sep 2016 17:14:46 +0300	[thread overview]
Message-ID: <87fuouaca1.fsf@gmail.com> (raw)
In-Reply-To: <87eg4g7zis.fsf_-_@gnu.org> ("Ludovic \=\?utf-8\?Q\?Court\=C3\=A8s\?\= \=\?utf-8\?Q\?\=22's\?\= message of "Mon, 19 Sep 2016 23:08:43 +0900")

Ludovic Courtès (2016-09-19 23:08 +0900) wrote:

> Alex Kost <alezost@gmail.com> skribis:
>
>> Ludovic Courtès (2016-09-14 16:58 +0200) wrote:
[...]
>>> However, we failed to build consensus around the approach of this patch,
>>> so we did not apply it.  If you have ideas, please email
>>> 20255@debbugs.gnu.org.  :-)
>>
>> I think I was the one who prevents the consensus.  To make it clear, I'm
>> for the suggested solution, but only *after* giving a user a freedom to
>> avoid loading such a heavy command as "guix package --search-paths".  On
>> a "usual" GNU/Linux distro a user can edit /etc/profile, but on GuixSD
>> it is not possible currently.  That's why I think there should be
>> provided a possibility to override /etc/profile at first.
>
> Indeed, thanks for the reminder!
>
> In fact, we have this through ‘etc-service-type’, except that currently
> /etc/profile is systematically added.
>
> So an idea that comes to mind is to allow ‘etc-service-type’ to be
> extended with procedures that would be able to filter or otherwise
> change the /etc entries (similar to what we do for PAM):
>
> diff --git a/gnu/services.scm b/gnu/services.scm
> index 7e322c5..9397232 100644
> --- a/gnu/services.scm
> +++ b/gnu/services.scm
> @@ -426,9 +426,13 @@ directory."
>                  (extensions
>                   (list
>                    (service-extension activation-service-type
> -                                     (lambda (files)
> -                                       (let ((etc
> -                                              (files->etc-directory files)))
> +                                     (lambda (files+procs)
> +                                       (let* ((proc (apply compose
> +                                                           (filter procedure?
> +                                                                   files+procs)))
> +                                              (files (filter pair? files+procs))
> +                                              (etc
> +                                               (files->etc-directory (proc files))))
>                                           #~(activate-etc #$etc))))
>                    (service-extension system-service-type etc-entry)))
>                  (compose concatenate)
>
>
> In your config, you could have something like:
>
>   (services (cons (simple-service 'rm-/etc/profile etc-service-type
>                                   (const (lambda (files)
>                                            (assoc-delete "profile" files))))
>                   %base-services))
>
> WDYT?

I think it would be great!  I didn't realize it can be implemented this
way.

> In fact I think we would need to have a more generic mechanism to hook
> into ‘fold-services’, but I’m not sure what it should look like.

Yeah, a more generic way would be better of course, but I think this
mixing of files and procedures is already good enough for now, as it
provides a freedom in customizing a system that we didn't have before.
Besides I will no longer object against the "search-paths" fix for the
bug 20255 :-)

-- 
Alex

  reply	other threads:[~2016-09-20 14:15 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-14  7:35 User-profile search paths should include system-profile directories Carlos Sánchez de La Lama
2016-09-14 14:58 ` Ludovic Courtès
2016-09-15  7:38   ` Alex Kost
2016-09-19 14:08     ` Customizing /etc Ludovic Courtès
2016-09-20 14:14       ` Alex Kost [this message]
2016-09-20  7:39   ` User-profile search paths should include system-profile directories Carlos Sánchez de La Lama
2016-09-20 14:25     ` Alex Kost
2016-09-20 14:38       ` Carlos Sánchez de La Lama
2016-09-21 15:22         ` Ludovic Courtès
2016-09-22  9:59           ` Carlos Sánchez de La Lama
2016-09-24  2:57             ` Ludovic Courtès
2016-09-26 11:19               ` Carlos Sánchez de La Lama
2016-09-30 20:16                 ` Ludovic Courtès
  -- strict thread matches above, loose matches on Subject: below --
2017-05-16  8:43 Customizing /etc Alex Kost
2017-05-17  8:28 ` Ludovic Courtès
2017-05-18 13:33   ` Alex Kost
     [not found] <877ftschjt.fsf@gmail.com>
     [not found] ` <87fv8fip01.fsf@gnu.org>
     [not found]   ` <87d23j1bxk.fsf@gmail.com>
     [not found]     ` <871tjyfnl8.fsf@gnu.org>
     [not found]       ` <876199q4z1.fsf@gmail.com>
     [not found]         ` <87ioca4ojo.fsf@gnu.org>
     [not found]           ` <87lh9tvcws.fsf@gnu.org>
     [not found]             ` <87h9kguwc4.fsf@gmail.com>
     [not found]               ` <87ziy7d90z.fsf@gnu.org>
     [not found]                 ` <874mgfkxee.fsf@gmail.com>
     [not found]                   ` <87wptb5d1y.fsf@gnu.org>
     [not found]                     ` <87r3jisc76.fsf@gmail.com>
     [not found]                       ` <87lh9q1f2i.fsf@gnu.org>
     [not found]                         ` <877fl9q3gv.fsf@gmail.com>
     [not found]                           ` <87h9kdy6ty.fsf@gnu.org>
     [not found]                             ` <871tbh53rt.fsf@gmail.com>
     [not found]                               ` <87vb8sss7j.fsf@gnu.org>
2015-11-23 20:07                                 ` Adding operating-system field for a custom /etc/profile Alex Kost
2015-11-24 15:22                                   ` 宋文武
2015-11-24 20:03                                     ` Alex Kost
2015-11-27 14:58                                       ` Customizing /etc Ludovic Courtès
2015-11-30  9:11                                         ` Alex Kost

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=87fuouaca1.fsf@gmail.com \
    --to=alezost@gmail.com \
    --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).