From 7597478e2e731c09890b25ff0b817d2d7c45d01f Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Mon, 6 Feb 2017 15:42:00 +0100 Subject: file-systems: Add '%network-configuration-files' and '%network-file-mappings'. * gnu/system/file-systems.scm (%network-configuration-files) (%network-file-mappings): New variables. * guix/scripts/environment.scm (%network-configuration-files): Remove. (launch-environment/container): Refer to '%network-file-mappings' instead of calling 'filter-map'. --- guix/scripts/environment.scm | 23 +---------------------- 1 file changed, 1 insertion(+), 22 deletions(-) (limited to 'guix/scripts/environment.scm') diff --git a/guix/scripts/environment.scm b/guix/scripts/environment.scm index 0a1205d087..44f490043c 100644 --- a/guix/scripts/environment.scm +++ b/guix/scripts/environment.scm @@ -60,12 +60,6 @@ (define %precious-variables (define %default-shell (or (getenv "SHELL") "/bin/sh")) -(define %network-configuration-files - '("/etc/resolv.conf" - "/etc/nsswitch.conf" - "/etc/services" - "/etc/hosts")) - (define (purify-environment) "Unset almost all environment variables. A small number of variables such as 'HOME' and 'USER' are left untouched." @@ -408,22 +402,7 @@ (define* (launch-environment/container #:key command bash user-mappings ;; When in Rome, do as Nix build.cc does: Automagically ;; map common network configuration files. (if network? - (filter-map (lambda (file) - (and (file-exists? file) - (file-system-mapping - (source file) - (target file) - ;; XXX: On some GNU/Linux - ;; systems, /etc/resolv.conf is a - ;; symlink to a file in a tmpfs - ;; which, for an unknown reason, - ;; cannot be bind mounted - ;; read-only within the - ;; container. - (writable? - (string=? file - "/etc/resolv.conf"))))) - %network-configuration-files) + %network-file-mappings '()) ;; Mappings for the union closure of all inputs. (map (lambda (dir) -- cgit v1.2.3