From mboxrd@z Thu Jan 1 00:00:00 1970 From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) Subject: Re: Tip of the day: storing your GuixSD config in the instantiated system Date: Wed, 30 Aug 2017 00:20:55 +0200 Message-ID: <87mv6iow1k.fsf@gnu.org> References: <871snzfl4s.fsf@gnu.org> <877exmhegq.fsf@elephly.net> 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]:43708) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dmosV-0007Gn-D5 for help-guix@gnu.org; Tue, 29 Aug 2017 18:21:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dmosU-0002wj-HZ for help-guix@gnu.org; Tue, 29 Aug 2017 18:20:59 -0400 In-Reply-To: <877exmhegq.fsf@elephly.net> (Ricardo Wurmus's message of "Tue, 29 Aug 2017 12:10:13 +0200") List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-guix-bounces+gcggh-help-guix=m.gmane.org@gnu.org Sender: "Help-Guix" To: Ricardo Wurmus Cc: help-guix Ricardo Wurmus skribis: > Ludovic Court=C3=A8s writes: > >> But wait: we can already store the config file in the instantiated >> system! Here=E2=80=99s how: >> >> (operating-system >> ;; =E2=80=A6 >> (services (cons (simple-service 'store-my-config >> etc-service-type >> `(("config.scm" >> ,(local-file (assoc-ref >> (current-source-loc= ation) >> 'filename))))) >> =E2=80=A6))) >> >> You instantiate that, and then /etc/config.scm (aka. >> /run/current-system/etc/config.scm, >> aka. /var/guix/profiles/system/etc/config.scm) contains the config file. > > When the system is =E2=80=9Cchecked out=E2=80=9D during boot, would it fa= il when > /etc/config.scm already exists? It certainly won=E2=80=99t just overwrit= e an > existing /etc/config.scm. Right, I think it=E2=80=99d fail gracelessly. > Also, this $profile/etc/config.scm would be read-only. So far we have > encouraged people to store their configuration file at /etc/config.scm. > If this service became a default then we probably should encourage > people to store their system config file template under version control > in the root user=E2=80=99s home directory (or similar), rather than recom= mending > the file to be placed in /etc. Yeah, it sounds like claiming this specific name, /etc/config.scm, is likely to cause problems. Unless the documentation for the new service insists on it? And yes, we should recommend putting config files under version-control, regardless of whether we add this new service. Ludo=E2=80=99.