From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id cGFRKN0nwl+ZMgAA0tVLHw (envelope-from ) for ; Sat, 28 Nov 2020 10:35:09 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id wAobJN0nwl+KTAAAbx9fmQ (envelope-from ) for ; Sat, 28 Nov 2020 10:35:09 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 62B1E94011A for ; Sat, 28 Nov 2020 10:35:09 +0000 (UTC) Received: from localhost ([::1]:38108 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kixZM-0004bY-7U for larch@yhetil.org; Sat, 28 Nov 2020 05:35:08 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:35058) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kixZG-0004bO-Lt for guix-patches@gnu.org; Sat, 28 Nov 2020 05:35:02 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:35454) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kixZG-0006Ac-F6 for guix-patches@gnu.org; Sat, 28 Nov 2020 05:35:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kixZG-00079f-C3 for guix-patches@gnu.org; Sat, 28 Nov 2020 05:35:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#44900] [PATCH] services: unattended-upgrade: Add 'search-paths' field. Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 28 Nov 2020 10:35:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 44900 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Lars-Dominik Braun Cc: 44900@debbugs.gnu.org Received: via spool by 44900-submit@debbugs.gnu.org id=B44900.160655964627432 (code B ref 44900); Sat, 28 Nov 2020 10:35:02 +0000 Received: (at 44900) by debbugs.gnu.org; 28 Nov 2020 10:34:06 +0000 Received: from localhost ([127.0.0.1]:47000 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kixYL-00078O-MU for submit@debbugs.gnu.org; Sat, 28 Nov 2020 05:34:05 -0500 Received: from eggs.gnu.org ([209.51.188.92]:44940) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kixYI-00077t-QT for 44900@debbugs.gnu.org; Sat, 28 Nov 2020 05:34:03 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]:42848) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kixYD-0005q0-Ey; Sat, 28 Nov 2020 05:33:57 -0500 Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=49906 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1kixYC-0004E3-Ek; Sat, 28 Nov 2020 05:33:56 -0500 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= References: <20201127084632.GA3077@zpidnp36> Date: Sat, 28 Nov 2020 11:33:55 +0100 In-Reply-To: <20201127084632.GA3077@zpidnp36> (Lars-Dominik Braun's message of "Fri, 27 Nov 2020 09:46:32 +0100") Message-ID: <87eekdrcrw.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-Spam-Score: -3.3 (---) X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: "Guix-patches" X-Migadu-Flow: FLOW_IN X-Migadu-Spam-Score: -2.77 X-Scanner: ns3122888.ip-94-23-21.eu Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-TUID: m3KFQUmQ7CI2 Hi, Lars-Dominik Braun skribis: > I=E2=80=99m using a modular machine configuration, i.e. the scheme file r= eturning the > operating system definition imports several other custom modules with ser= vice > definitions etc in the same directory. This does not work well with unatt= ended > upgrades. The attached patch allows adding search paths to the unattended > upgrade service. I=E2=80=99m not sure this is the best solution though. M= aybe the > preferred way to add these modules is to a custom channel? Did you see (info "(guix) Unattended Upgrades"): There are cases, though, where referring to =E2=80=98/run/current-system/configuration.scm=E2=80=99 is not en= ough, for instance because that file refers to extra files (SSH public keys, extra configuration files, etc.) via =E2=80=98local-file= =E2=80=99 and similar constructs. For those cases, we recommend something along these lines: (unattended-upgrade-configuration (operating-system-file (file-append (local-file "." "config-dir" #:recursive? #= t) "/config.scm"))) The effect here is to import all of the current directory into the store, and to refer to =E2=80=98config.scm=E2=80=99 within th= at directory. Therefore, uses of =E2=80=98local-file=E2=80=99 within =E2=80=98c= onfig.scm=E2=80=99 will work as expected. *Note G-Expressions::, for information about =E2=80=98local-file=E2=80=99 and =E2=80=98file-append=E2=80=99. I can see several options: 1. Use the trick above and add (say): (add-to-load-path (dirname (current-filename))) in your config file. Not pretty. 2. Turn your modules into a channel. Nice because there=E2=80=99s no nee= d for a special case, modules are automatically updated at each upgrade, etc., but OTOH requires more paperwork. 3. What you propose. Easy to use but a bit low-level and users could be tempted to pass local file names instead of using =E2=80=98local-fi= le=E2=80=99, in which case the process becomes more brittle (depends on things outside the store). > The second patch changes the default channels to #f, i.e. the system defa= ult > (/etc/guix/channels.scm), which feels more natural to me. I prefer being explicit here and keep =E2=80=98unattended-upgrade-configura= tion=E2=80=99 self-contained (/etc/guix/channels.scm could be modified behind our back). WDYT? Thanks, Ludo=E2=80=99.