From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ricardo Wurmus Subject: Re: Tip of the day: storing your GuixSD config in the instantiated system Date: Tue, 29 Aug 2017 12:10:13 +0200 Message-ID: <877exmhegq.fsf@elephly.net> References: <871snzfl4s.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:34916) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dmdTV-0001BT-1s for help-guix@gnu.org; Tue, 29 Aug 2017 06:10:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dmdTT-0005HR-Uz for help-guix@gnu.org; Tue, 29 Aug 2017 06:10:25 -0400 In-reply-to: <871snzfl4s.fsf@gnu.org> 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: Ludovic =?utf-8?Q?Court=C3=A8s?= Cc: help-guix Ludovic Courtès writes: > But wait: we can already store the config file in the instantiated > system! Here’s how: > > (operating-system > ;; … > (services (cons (simple-service 'store-my-config > etc-service-type > `(("config.scm" > ,(local-file (assoc-ref > (current-source-location) > 'filename))))) > …))) > > 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 “checked out” during boot, would it fail when /etc/config.scm already exists? It certainly won’t just overwrite an existing /etc/config.scm. 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’s home directory (or similar), rather than recommending the file to be placed in /etc. -- Ricardo GPG: BCA6 89B6 3655 3801 C3C6 2150 197A 5888 235F ACAC https://elephly.net