From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alex Kost Subject: bug#20720: Inconsistency in text fields for 'operating-system' Date: Fri, 05 Jun 2015 16:27:39 +0300 Message-ID: <87oaku8eus.fsf@gmail.com> References: <87egludumx.fsf@gmail.com> <87r3ptw23a.fsf@gnu.org> <87y4jzwn2s.fsf@gmail.com> <874mmmjq1g.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]:59978) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z0rgK-0005LE-LY for bug-guix@gnu.org; Fri, 05 Jun 2015 09:29:10 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z0rgH-00006Y-Bq for bug-guix@gnu.org; Fri, 05 Jun 2015 09:29:08 -0400 Received: from debbugs.gnu.org ([140.186.70.43]:59512) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z0rgH-00006P-7K for bug-guix@gnu.org; Fri, 05 Jun 2015 09:29:05 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1Z0rgG-0003GP-BE for bug-guix@gnu.org; Fri, 05 Jun 2015 09:29:04 -0400 Sender: "Debbugs-submit" Resent-Message-ID: In-Reply-To: <874mmmjq1g.fsf@gnu.org> ("Ludovic \=\?utf-8\?Q\?Court\=C3\=A8s\=22'\?\= \=\?utf-8\?Q\?s\?\= message of "Fri, 05 Jun 2015 14:30:35 +0200") List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guix-bounces+gcggb-bug-guix=m.gmane.org@gnu.org Sender: bug-guix-bounces+gcggb-bug-guix=m.gmane.org@gnu.org To: Ludovic =?UTF-8?Q?Court=C3=A8s?= Cc: 20720@debbugs.gnu.org Ludovic Court=C3=A8s (2015-06-05 15:30 +0300) wrote: > Alex Kost skribis: > >> Ludovic Court=C3=A8s (2015-06-03 12:52 +0300) wrote: > > [...] > >>> An important criterion is whether the file needs to contain references >>> to store items or not. For =E2=80=98sudoers=E2=80=99 and =E2=80=98issu= e=E2=80=99, that=E2=80=99s normally not >>> the case, and these are usually small files or computable files, so I >>> think it=E2=80=99s fine to use strings here (more convenient than files= .) >> >> Well, I don't agree about =E2=80=98sudoers=E2=80=99. It may be a really= big file. Mine >> is not so big, but it is 40 lines long (including some useful comments), >> so I have to use some additional guile code to convert the contents of >> the file into string. > > Ah, good point. So let=E2=80=99s turn =E2=80=98sudoers=E2=80=99 into a f= ile-like object. Thanks! >>> Using monadic values as for =E2=80=98hosts-file=E2=80=99 and #:motd is = not nice. These >>> should be changed to use either a string or a file. >>> >>> The best would be to always use a file-like object. I=E2=80=99ve just = added >>> =E2=80=98plain-file=E2=80=99 for that reason. Now I would change #:mot= d and >>> =E2=80=98hosts-file=E2=80=99 to take a file-like object rather than a m= onadic value. >>> >>> WDYT? >> >> I beg a pardon, but if I inderstand it correctly (probably not), I don't >> see a difference from the user point of view. Previously it was: >> >> (hosts-file (text-file "hosts" "...")) >> >> and now it would be: >> >> (hosts-file (plain-file "hosts" "...")) > > Right. But it could also be: > > (hosts-file (local-file "/home/foo/my-hosts-file.txt")) > > This form is pleasant when the file can be long or when it has special > syntax and you=E2=80=99d rather use the editor=E2=80=99s syntax highlight= ing. Ah, This is great! Thank you. >> I think I'm not competent as I have a vague understanding of all this >> stuff and of user's needs (except mine =E2=98=BA). What I would like to= have, >> is a possibility to specify my configuration files for various services >> and operating-system fields. I don't want to write text configs in my >> os-config.scm file (as it happens now with =E2=80=98hosts-file=E2=80=99). > > OK. So that=E2=80=99s definitely in favor of using file-like objects pre= tty > much everywhere. Yes :-) >> I'm very happy with the current behaviour of =E2=80=98syslog-service=E2= =80=99, >> =E2=80=98lirc-service=E2=80=99 and =E2=80=98console-keymap-service=E2=80= =99 where I just specify file >> names, e.g.: >> >> (syslog-service #:config-file "/home/me/my-favourite-syslog.conf") >> >> and I like this =E2=86=91 way of specifying configurations very much! T= hat's >> what I would like to see in =E2=80=98sudoers=E2=80=99 and =E2=80=98hosts= -file=E2=80=99 fields. > > OK. Note that this form (directly using a local file name) works > somewhat by chance and should not be used because it defeats > reproducibility. That is, your OS configuration actually depends on > that file in /home, which may be modified or deleted anytime, thereby > changing the syslogd behavior in unpredicable ways. Yes, that's exactly what I want! I realize the benefits of the reproducibility but often I just want my system to depend on /home/... files that can be modified anytime. > The right thing to do is: > > (syslog-service #:config-file > (local-file "/home/me/my-favourite-syslog.conf")) > > This means that the config file is automatically added to the store and > made part of the closure of the OS config. Now if > "/home/me/my-favourite-syslog.conf" is removed/modified, the OS behavior > remains unchanged. And that's exactly what I don't want! I don't want my config files to be put into the store. Because I have to reconfigure the system to see the changes. With my current unpredicable way, I can change my syslog.conf and the next time I boot into the same system, I will face the changes I made. I realize that it sounds like a strange whim and is not what is supposed to be done, but, well, I just like it :-) > I=E2=80=99ll prepare a patch for that and report back. Thank you, in spite of all I said earlier, I really like =E2=80=98local-fil= e=E2=80=99! --=20 Alex