guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

02/03: guix system: Do not import the user's (guix config).


From: guix-commits
Subject: 02/03: guix system: Do not import the user's (guix config).
Date: Thu, 2 Apr 2020 17:16:53 -0400 (EDT)

civodul pushed a commit to branch master
in repository guix.

commit a6850f6827869cd20feb1d4cc5abf6744b6cc164
Author: Ludovic Courtès <address@hidden>
AuthorDate: Thu Apr 2 22:09:43 2020 +0200

    guix system: Do not import the user's (guix config).
    
    Previously, 'switch-to-system.drv' and 'install-bootloader.drv' would
    depend on the user's (guix config) module.  This is no longer the case.
    
    * guix/scripts/system/reconfigure.scm (not-config?): New procedure.
    (switch-system-program): Do not import the user's (guix config).  Use
    'make-config.scm' instead.
    (install-bootloader-program): Likewise.
---
 guix/scripts/system/reconfigure.scm | 31 +++++++++++++++++++++++--------
 1 file changed, 23 insertions(+), 8 deletions(-)

diff --git a/guix/scripts/system/reconfigure.scm 
b/guix/scripts/system/reconfigure.scm
index 77a7230..c8d1ed4 100644
--- a/guix/scripts/system/reconfigure.scm
+++ b/guix/scripts/system/reconfigure.scm
@@ -1,5 +1,5 @@
 ;;; GNU Guix --- Functional package management for GNU
-;;; Copyright © 2014, 2015, 2016, 2017, 2018, 2019 Ludovic Courtès 
<address@hidden>
+;;; Copyright © 2014, 2015, 2016, 2017, 2018, 2019, 2020 Ludovic Courtès 
<address@hidden>
 ;;; Copyright © 2016 Alex Kost <address@hidden>
 ;;; Copyright © 2016, 2017, 2018 Chris Marusich <address@hidden>
 ;;; Copyright © 2017 Mathieu Othacehe <address@hidden>
@@ -33,6 +33,7 @@
   #:use-module (guix modules)
   #:use-module (guix monads)
   #:use-module (guix store)
+  #:use-module ((guix self) #:select (make-config.scm))
   #:use-module (ice-9 match)
   #:use-module (srfi srfi-1)
   #:use-module (srfi srfi-11)
@@ -60,6 +61,14 @@
 ;;; Profile creation.
 ;;;
 
+(define not-config?
+  ;; Select (guix …) and (gnu …) modules, except (guix config).
+  (match-lambda
+    (('guix 'config) #f)
+    (('guix rest ...) #t)
+    (('gnu rest ...) #t)
+    (_ #f)))
+
 (define* (switch-system-program os #:optional profile)
   "Return an executable store item that, upon being evaluated, will create a
 new generation of PROFILE pointing to the directory of OS, switch to it
@@ -67,9 +76,11 @@ atomically, and run OS's activation script."
   (program-file
    "switch-to-system.scm"
    (with-extensions (list guile-gcrypt)
-     (with-imported-modules (source-module-closure '((guix config)
-                                                     (guix profiles)
-                                                     (guix utils)))
+     (with-imported-modules `(,@(source-module-closure
+                                 '((guix profiles)
+                                   (guix utils))
+                                 #:select? not-config?)
+                              ((guix config) => ,(make-config.scm)))
        #~(begin
            (use-modules (guix config)
                         (guix profiles)
@@ -184,10 +195,13 @@ BOOTLOADER-PACKAGE."
   (program-file
    "install-bootloader.scm"
    (with-extensions (list guile-gcrypt)
-     (with-imported-modules (source-module-closure '((gnu build bootloader)
-                                                     (gnu build install)
-                                                     (guix store)
-                                                     (guix utils)))
+     (with-imported-modules `(,@(source-module-closure
+                                 '((gnu build bootloader)
+                                   (gnu build install)
+                                   (guix store)
+                                   (guix utils))
+                                 #:select? not-config?)
+                              ((guix config) => ,(make-config.scm)))
        #~(begin
            (use-modules (gnu build bootloader)
                         (gnu build install)
@@ -197,6 +211,7 @@ BOOTLOADER-PACKAGE."
                         (ice-9 binary-ports)
                         (srfi srfi-34)
                         (srfi srfi-35))
+
            (let* ((gc-root (string-append #$target %gc-roots-directory 
"/bootcfg"))
                   (new-gc-root (string-append gc-root ".new")))
              ;; #$bootcfg has dependencies.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]