From mboxrd@z Thu Jan 1 00:00:00 1970 From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) Subject: Tip of the day: storing your GuixSD config in the instantiated system Date: Fri, 25 Aug 2017 22:27:47 +0200 Message-ID: <871snzfl4s.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]:45673) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dlLD2-0006lN-BD for help-guix@gnu.org; Fri, 25 Aug 2017 16:28:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dlLCz-0003bE-5p for help-guix@gnu.org; Fri, 25 Aug 2017 16:28:04 -0400 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:40361) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dlLCz-0003bA-2A for help-guix@gnu.org; Fri, 25 Aug 2017 16:28:01 -0400 Received: from x4db12c76.dyn.telefonica.de ([77.177.44.118]:48182 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1dlLCx-0008Ai-UT for help-guix@gnu.org; Fri, 25 Aug 2017 16:28:00 -0400 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: help-guix Hello Guix! Following a discussion we had at the GHM today, here=E2=80=99s the tip of t= he day! People often ask how they could store their GuixSD config alongside the instantiated system in the store. Guix maintainers usually grumpily reply =E2=80=9Cnah, don=E2=80=99t do this, because the config file is not self-contained, so that=E2=80=99s not good enough.=E2=80=9D 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-locati= on) '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. Pretty neat no? Enjoy! Ludo=E2=80=99.