From mboxrd@z Thu Jan 1 00:00:00 1970 From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) Subject: Customizing /etc Date: Fri, 27 Nov 2015 15:58:07 +0100 Message-ID: <87a8pz7am8.fsf_-_@gnu.org> References: <877ftschjt.fsf@gmail.com> <87fv8fip01.fsf@gnu.org> <87d23j1bxk.fsf@gmail.com> <871tjyfnl8.fsf@gnu.org> <876199q4z1.fsf@gmail.com> <87ioca4ojo.fsf@gnu.org> <87lh9tvcws.fsf@gnu.org> <87h9kguwc4.fsf@gmail.com> <87ziy7d90z.fsf@gnu.org> <874mgfkxee.fsf@gmail.com> <87wptb5d1y.fsf@gnu.org> <87r3jisc76.fsf@gmail.com> <87lh9q1f2i.fsf@gnu.org> <877fl9q3gv.fsf@gmail.com> <87h9kdy6ty.fsf@gnu.org> <871tbh53rt.fsf@gmail.com> <87vb8sss7j.fsf@gnu.org> <87y4doscmg.fsf_-_@gmail.com> <3fa07a3d615d80be9fb10da9e026ae48@openmailbox.org> <87ziy3qi5c.fsf@gmail.com> 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]:33758) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a2KTW-0007XV-7d for guix-devel@gnu.org; Fri, 27 Nov 2015 09:58:15 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a2KTS-0001eJ-64 for guix-devel@gnu.org; Fri, 27 Nov 2015 09:58:14 -0500 In-Reply-To: <87ziy3qi5c.fsf@gmail.com> (Alex Kost's message of "Tue, 24 Nov 2015 23:03:43 +0300") 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-bounces+gcggd-guix-devel=m.gmane.org@gnu.org To: Alex Kost Cc: =?utf-8?B?5a6L5paH5q2m?= , guix-devel@gnu.org Alex Kost skribis: > =E5=AE=8B=E6=96=87=E6=AD=A6 (2015-11-24 18:22 +0300) wrote: [...] >> So, the plan is add /etc/environment and only use /etc/profile for 2. >> then, a sh-profile file-like configuration can be added. WDYT? > > I like the idea of separating /etc/environment and /etc/profile, but my > main concern is to have a possibility to change /etc files the way I > want, as I explained in the reply to Ludovic. I agree that specifying what goes into /etc is something we want to allow (though not directly related to the /etc/profile issue.) What about exposing the name/file-like pairs that are passed to =E2=80=98etc-service=E2=80=99? That way, one could write: (define os (operating-system ;; =E2=80=A6 (etc-files `(("hosts" ,(local-file "my-hosts-file")) ("issue" ,(plain-file "Hello!\n")) ("sudoers" ,(local-file "sudoers")) ("profile" ,(local-file "myprofile")) ,@(fold alist-delete (default-etc-files os) '("hosts" "issue" "sudoers" "profile")))))) We may remove the =E2=80=98hosts-file=E2=80=99 and =E2=80=98sudoers-file=E2= =80=99 fields, but keep higher-level things like =E2=80=98name-service-switch=E2=80=99 because they= =E2=80=99re more convenient. The difficulty is that some of the default files, such as /etc/hosts, are generated as a function of the =E2=80=98operating-system=E2=80=99 decla= ration. Thus I think we need =E2=80=98default-etc-files=E2=80=99 to be a procedure as sh= own above, and the =E2=80=98etc-files=E2=80=99 field must be thunked or delayed. Hmm = not fully sure this is the right interface. WDYT? The bottom line is that /etc is not a great configuration interface because it=E2=80=99s all flat and GuixSD has no idea of the meaning of those files and their relationship. So the preferred approach remains configuration via services and high-level configuration objects. Thanks, Ludo=E2=80=99.