unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / code / Atom feed
From: pukkamustard <pukkamustard@posteo.net>
To: John Soo <jsoo1@asu.edu>
Cc: 46297@debbugs.gnu.org
Subject: bug#46297: nix-service-configuration is missing the default /bin/sh
Date: Wed, 21 Apr 2021 15:00:09 +0000	[thread overview]
Message-ID: <864kfzir0q.fsf@posteo.net> (raw)
In-Reply-To: <87im77pssd.fsf@asu.edu>

[-- Attachment #1: Type: text/plain, Size: 235 bytes --]


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.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-services-nix-Remove-build-sandbox-items-configuratio.patch --]
[-- Type: text/x-patch, Size: 3251 bytes --]

From 886410216c7b1fb6572e7cfdd83dcbd6836e78e4 Mon Sep 17 00:00:00 2001
From: pukkamustard <pukkamustard@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


[-- Attachment #3: Type: text/plain, Size: 76 bytes --]


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

Thanks,
pukkamustard


  reply	other threads:[~2021-04-21 15:42 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-04 16:00 bug#46297: nix-service-configuration is missing the default /bin/sh John Soo
2021-02-04 18:54 ` John Soo
2021-04-21 15:00   ` pukkamustard [this message]
2021-04-22  6:59     ` Oleg Pykhalov
2021-04-22  7:30       ` pukkamustard
2021-04-22 16:50         ` Oleg Pykhalov
2021-04-26  7:21           ` pukkamustard
2021-04-26 17:06             ` Oleg Pykhalov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=864kfzir0q.fsf@posteo.net \
    --to=pukkamustard@posteo.net \
    --cc=46297@debbugs.gnu.org \
    --cc=jsoo1@asu.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).