From: phodina via Guix-patches via <guix-patches@gnu.org>
To: "Ludovic Courtès" <ludo@gnu.org>
Cc: "58903@debbugs.gnu.org" <58903@debbugs.gnu.org>,
"go.wigust@gmail.com" <go.wigust@gmail.com>,
Tobias Geerinckx-Rice <me@tobias.gr>,
"i@pengmeiyu.com" <i@pengmeiyu.com>
Subject: [bug#58903] [PATCH] gnu: nix: Update to 2.11.1.
Date: Tue, 13 Dec 2022 12:27:28 +0000 [thread overview]
Message-ID: <cXmB-1qjfJBI9w-rIVrNe_3nsOC6GKDOV4EtxzcnZ65IRs0XjWc1WXcOyAjPiTAgJ3lAFQGSe1zW-bqQFAdMqn6a6lRMDytwyajrw_5JLxo=@protonmail.com> (raw)
In-Reply-To: <87v8nnn3vm.fsf_-_@gnu.org>
[-- Attachment #1: Type: text/plain, Size: 254 bytes --]
Hello Ludo’,
here's the updated patch with the text as you suggested. I removed the previous long paragraph which was to detailed and would only lengthen the Guix documentation :)
Also good idea to reference the guix daemon. Thanks.
----
Petr
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: v3-0001-services-nix-Add-more-configuration-fields.patch --]
[-- Type: text/x-patch; name=v3-0001-services-nix-Add-more-configuration-fields.patch, Size: 3122 bytes --]
From 5b38fc4945224df40ceca3736ee40becbda51853 Mon Sep 17 00:00:00 2001
From: Petr Hodina <phodina@protonmail.com>
Date: Mon, 31 Oct 2022 16:12:38 +0100
Subject: [PATCH v3] services: nix: Add more configuration fields.
* gnu/services/nix.scm (<nix-configuration>)[build-directory]: New field.
(nix-service-etc, nix-shepherd-service): Take them into account.
* doc/guix.texi (Nix): Update it.
diff --git a/doc/guix.texi b/doc/guix.texi
index 50487a5172..69ac5de066 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -37209,6 +37209,15 @@ The Nix package to use.
@item @code{sandbox} (default: @code{#t})
Specifies whether builds are sandboxed by default.
+@item @code{build-directory} (default: @code{"/tmp"})
+The directory where build directory are stored during builds.
+This is useful to change if, for example, the default location does not
+have enough space to hold build trees for big packages.
+
+This is similar to setting the @env{TMPDIR} environment variable for
+@command{guix-daemon}. @ref{Build Environment Setup, @env{TMPDIR}},
+for more info.
+
@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.
diff --git a/gnu/services/nix.scm b/gnu/services/nix.scm
index df04a85c22..dcf994b603 100644
--- a/gnu/services/nix.scm
+++ b/gnu/services/nix.scm
@@ -54,6 +54,8 @@ (define-record-type* <nix-configuration>
(default nix))
(sandbox nix-configuration-sandbox ;boolean
(default #t))
+ (build-directory nix-configuration-build-directory ;string
+ (default "/tmp"))
(build-sandbox-items nix-configuration-build-sandbox-items ;list of strings
(default '()))
(extra-config nix-configuration-extra-config ;list of strings
@@ -106,7 +108,7 @@ (define (nix-activation _)
(define nix-service-etc
(match-lambda
- (($ <nix-configuration> package sandbox build-sandbox-items extra-config)
+ (($ <nix-configuration> package sandbox build-directory build-sandbox-items extra-config)
(let ((ref-file (references-file package)))
`(("nix/nix.conf"
,(computed-file
@@ -130,7 +132,7 @@ (define internal-sandbox-paths
(define nix-shepherd-service
;; Return a <shepherd-service> for Nix.
(match-lambda
- (($ <nix-configuration> package _ _ _ extra-options)
+ (($ <nix-configuration> package _ build-directory _ _ extra-options)
(list
(shepherd-service
(provision '(nix-daemon))
@@ -138,7 +140,10 @@ (define nix-shepherd-service
(requirement '())
(start #~(make-forkexec-constructor
(list (string-append #$package "/bin/nix-daemon")
- #$@extra-options)))
+ #$@extra-options)
+ #:environment-variables
+ (list (string-append "TMPDIR=" build-directory)
+ "PATH=/run/current-system/profile/bin")))
(respawn? #f)
(stop #~(make-kill-destructor)))))))
--
2.38.1
next prev parent reply other threads:[~2022-12-13 12:28 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-30 20:45 [bug#58903] [PATCH] gnu: nix: Update to 2.11.1 phodina via Guix-patches via
2022-10-31 15:37 ` [bug#58903] Specify the build dir for Nix phodina via Guix-patches via
2022-10-31 15:45 ` Tobias Geerinckx-Rice via Guix-patches via
2022-10-31 19:18 ` phodina via Guix-patches via
2022-11-09 22:45 ` [bug#58903] [PATCH] gnu: nix: Update to 2.11.1 Ludovic Courtès
2022-12-13 12:27 ` phodina via Guix-patches via [this message]
2022-12-13 16:52 ` bug#58903: " Ludovic Courtès
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='cXmB-1qjfJBI9w-rIVrNe_3nsOC6GKDOV4EtxzcnZ65IRs0XjWc1WXcOyAjPiTAgJ3lAFQGSe1zW-bqQFAdMqn6a6lRMDytwyajrw_5JLxo=@protonmail.com' \
--to=guix-patches@gnu.org \
--cc=58903@debbugs.gnu.org \
--cc=go.wigust@gmail.com \
--cc=i@pengmeiyu.com \
--cc=ludo@gnu.org \
--cc=me@tobias.gr \
--cc=phodina@protonmail.com \
/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).