From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alex Kost Subject: Re: Customizing /etc Date: Tue, 20 Sep 2016 17:14:46 +0300 Message-ID: <87fuouaca1.fsf@gmail.com> References: <7tpoo7kk73.fsf@gmail.com> <87eg4mo7dp.fsf@gnu.org> <87twdhobnp.fsf@gmail.com> <87eg4g7zis.fsf_-_@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:48384) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bmLpx-0007dZ-F0 for guix-devel@gnu.org; Tue, 20 Sep 2016 10:15:58 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bmLps-0007q4-Ab for guix-devel@gnu.org; Tue, 20 Sep 2016 10:15:52 -0400 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") List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: "Guix-devel" To: Ludovic =?utf-8?Q?Court=C3=A8s?= Cc: guix-devel@gnu.org Ludovic Court=C3=A8s (2016-09-19 23:08 +0900) wrote: > Alex Kost skribis: > >> Ludovic Court=C3=A8s (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 =E2=80=98etc-service-type=E2=80=99, except = that currently > /etc/profile is systematically added. > > So an idea that comes to mind is to allow =E2=80=98etc-service-type=E2=80= =99 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 file= s))) > + (lambda (files+procs) > + (let* ((proc (apply compose > + (filter proce= dure? > + files= +procs))) > + (files (filter pair? files= +procs)) > + (etc > + (files->etc-directory (pr= oc 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 =E2=80=98fold-services=E2=80=99, but I=E2=80=99m not sure what it sh= ould 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 :-) --=20 Alex