I ran into the same issue and agree with your conclusion that we may not need build-sandbox-paths.

Attached a patch that removes the `build-sandbox-paths` option. This causes nix to use the default value which seems to work fine.

>From 886410216c7b1fb6572e7cfdd83dcbd6836e78e4 Mon Sep 17 00:00:00 2001
From: pukkamustard <pukkamust...@posteo.net>
Date: Wed, 21 Apr 2021 17:19:36 +0200
Subject: [PATCH] services: nix: Remove build-sandbox-items configuration.

* gnu/services/nix.scm (<nix-configuration>)[build-sandbox-items]: Remove field.
* doc/guix.texi (Miscellaneous Services)[Nix service]: Remove build-sandbox-items.
---
 doc/guix.texi        |  4 ----
 gnu/services/nix.scm | 30 ++++++++++--------------------
 2 files changed, 10 insertions(+), 24 deletions(-)

diff --git a/doc/guix.texi b/doc/guix.texi
index b9019d5550..44e545952f 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -31993,10 +31993,6 @@ The Nix package to use.
 @item @code{sandbox} (default: @code{#t})
 Specifies whether builds are sandboxed by default.
 
-@item @code{build-sandbox-items} (default: @code{'()})
-This is a list of strings or objects appended to the
-@code{build-sandbox-items} field of the configuration file.
-
 @item @code{extra-config} (default: @code{'()})
 This is a list of strings or objects appended to the configuration file.
 It is used to pass extra text to be added verbatim to the configuration
diff --git a/gnu/services/nix.scm b/gnu/services/nix.scm
index 1aef47db0a..537555596c 100644
--- a/gnu/services/nix.scm
+++ b/gnu/services/nix.scm
@@ -53,8 +53,6 @@
                        (default nix))
   (sandbox             nix-configuration-sandbox ;boolean
                        (default #t))
-  (build-sandbox-items nix-configuration-build-sandbox-items ;list of strings
-                       (default '()))
   (extra-config        nix-configuration-extra-config ;list of strings
                        (default '()))
   (extra-options       nix-configuration-extra-options ;list of strings
@@ -106,24 +104,16 @@ GID."
 (define nix-service-etc
   (match-lambda
     (($ <nix-configuration> package sandbox build-sandbox-items extra-config)
-     (let ((ref-file (references-file package)))
-       `(("nix/nix.conf"
-          ,(computed-file
-            "nix.conf"
-            #~(begin
-                (use-modules (srfi srfi-26)
-                             (ice-9 format))
-                (with-output-to-file #$output
-                  (lambda _
-                    (define internal-sandbox-paths
-                      (call-with-input-file #$ref-file read))
-
-                    (format #t "sandbox = ~a~%" (if #$sandbox "true" "false"))
-                    ;; config.nix captures store file names.
-                    (format #t "build-sandbox-paths = ~{~a ~}~%"
-                            (append internal-sandbox-paths
-                                    '#$build-sandbox-items))
-                    (for-each (cut display <>) '#$extra-config)))))))))))
+     `(("nix/nix.conf"
+        ,(computed-file
+          "nix.conf"
+          #~(begin
+              (use-modules (srfi srfi-26)
+                           (ice-9 format))
+              (with-output-to-file #$output
+                (lambda _
+                  (format #t "sandbox = ~a~%" (if #$sandbox "true" "false"))
+                  (for-each (cut display <>) '#$extra-config))))))))))
 
 (define nix-shepherd-service
   ;; Return a <shepherd-service> for Nix.
-- 
2.31.1


CC: Oleg Pykhalov who seems to have worked on this.

Thanks,
pukkamustard

Reply via email to