summary refs log tree commit diff
path: root/gnu/machine/ssh.scm
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2021-01-04 11:29:17 +0100
committerLudovic Courtès <ludo@gnu.org>2021-01-04 11:51:48 +0100
commit61d8bd56a4644a72b964b680456da4332eb1ef6d (patch)
treee37345f74844f9f008b2c8eb7640285865b4e855 /gnu/machine/ssh.scm
parent9158020d7853b6e7925802e0d0a082801c680e8f (diff)
downloadguix-61d8bd56a4644a72b964b680456da4332eb1ef6d.tar.gz
machine: ssh: Do not import the host (guix config), really.
This is a followup to 70ffa8af1e93ab8a92c4622745e9cb4a2782f3c8, which
did not really solve the problem.

* gnu/machine/ssh.scm (not-config?): New procedure.
(machine-boot-parameters): Use it as an argument to
'source-module-closure'.
Diffstat (limited to 'gnu/machine/ssh.scm')
-rw-r--r--gnu/machine/ssh.scm17
1 files changed, 13 insertions, 4 deletions
diff --git a/gnu/machine/ssh.scm b/gnu/machine/ssh.scm
index 08c653ba17..997d673e75 100644
--- a/gnu/machine/ssh.scm
+++ b/gnu/machine/ssh.scm
@@ -1,6 +1,6 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2019 Jakob L. Kreuze <zerodaysfordays@sdf.org>
-;;; Copyright © 2020 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2020, 2021 Ludovic Courtès <ludo@gnu.org>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -346,6 +346,14 @@ by MACHINE."
 ;;; System deployment.
 ;;;
 
+(define not-config?
+  ;; Select (guix …) and (gnu …) modules, except (guix config).
+  (match-lambda
+    (('guix 'config) #f)
+    (('guix _ ...) #t)
+    (('gnu _ ...) #t)
+    (_ #f)))
+
 (define (machine-boot-parameters machine)
   "Monadic procedure returning a list of 'boot-parameters' for the generations
 of MACHINE's system profile, ordered from most recent to oldest."
@@ -354,9 +362,10 @@ of MACHINE's system profile, ordered from most recent to oldest."
 
   (define remote-exp
     (with-extensions (list guile-gcrypt)
-      (with-imported-modules (source-module-closure
-                              `(((guix config) => ,(make-config.scm))
-                                (guix profiles)))
+      (with-imported-modules `(((guix config) => ,(make-config.scm))
+                               ,@(source-module-closure
+                                  '((guix profiles))
+                                  #:select? not-config?))
         #~(begin
             (use-modules (guix config)
                          (guix profiles)