From patchwork Tue Dec 13 12:27:28 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: phodina X-Patchwork-Id: 45233 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 5DAC427BBEC; Tue, 13 Dec 2022 12:28:14 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-3.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H2, SPF_HELO_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 0CCF627BBE9 for ; Tue, 13 Dec 2022 12:28:13 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p54OD-00061I-7L; Tue, 13 Dec 2022 07:28:05 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p54OB-00060y-KG for guix-patches@gnu.org; Tue, 13 Dec 2022 07:28:03 -0500 Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1p54OA-0002v1-46 for guix-patches@gnu.org; Tue, 13 Dec 2022 07:28:03 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1p54O9-0004R4-VC for guix-patches@gnu.org; Tue, 13 Dec 2022 07:28:01 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#58903] [PATCH] gnu: nix: Update to 2.11.1. Resent-From: phodina Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 13 Dec 2022 12:28:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 58903 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: moreinfo patch To: Ludovic =?utf-8?q?Court=C3=A8s?= Cc: "58903@debbugs.gnu.org" <58903@debbugs.gnu.org>, "go.wigust@gmail.com" , Tobias Geerinckx-Rice , "i@pengmeiyu.com" Received: via spool by 58903-submit@debbugs.gnu.org id=B58903.167093446117036 (code B ref 58903); Tue, 13 Dec 2022 12:28:01 +0000 Received: (at 58903) by debbugs.gnu.org; 13 Dec 2022 12:27:41 +0000 Received: from localhost ([127.0.0.1]:60036 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p54Np-0004Qi-A6 for submit@debbugs.gnu.org; Tue, 13 Dec 2022 07:27:41 -0500 Received: from mail-40133.protonmail.ch ([185.70.40.133]:15265) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p54Nn-0004QZ-59 for 58903@debbugs.gnu.org; Tue, 13 Dec 2022 07:27:39 -0500 Date: Tue, 13 Dec 2022 12:27:28 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail3; t=1670934452; x=1671193652; bh=rexeqRyS9FgEq0GJ3JbkFO0hnzElb7ZrquKR+wWMt50=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID:BIMI-Selector; b=icGvfgORhue+yctLaAuMZaT4iL2ujo5d95fb0BiSytltQQDehsbhqdo7GRvZTShPZ 98Wg4dbfwrINwMsXxfNCY5UvOgV51++HzABY4ewzrQztkQ5yjDK4wo2kGiqpBLuM6T RhZCDzIt40Z7dVlo0UxiClk64Aj2gZeNrWfRT12oJ3xpdzBcJVxZiH8hrCn95IlGXn ugK4Kf5U5ZhSIc7BUCMXwkceJHQY62irVEvgfO9pfqnAake7vplRMmX79FVD5KVTGh RlvPMqkHn8hUXKcJj33YwbiexHPJppzMEGWJIA/fUKu+NZOsAIGVek10SCvxZZYT0t o4qIM4Go3tHMA== Message-ID: In-Reply-To: <87v8nnn3vm.fsf_-_@gnu.org> References: <89-rZ-T-EfdANIf7D2MDU2c9GRrDND1-wshyPcAx6X4dE6AJnN-N9N2r_93XsmOnKcrGShflEKyle5bRxtumYcHvcgwwF_3DZvZUPOSLr70=@protonmail.com> <87sfj4551q.fsf@nckx> <87v8nnn3vm.fsf_-_@gnu.org> Feedback-ID: 14143818:user:proton MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-to: phodina X-ACL-Warn: , phodina via Guix-patches X-Patchwork-Original-From: phodina via Guix-patches via From: phodina Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches 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 From 5b38fc4945224df40ceca3736ee40becbda51853 Mon Sep 17 00:00:00 2001 From: Petr Hodina Date: Mon, 31 Oct 2022 16:12:38 +0100 Subject: [PATCH v3] services: nix: Add more configuration fields. * gnu/services/nix.scm ()[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* (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 - (($ package sandbox build-sandbox-items extra-config) + (($ 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 for Nix. (match-lambda - (($ package _ _ _ extra-options) + (($ 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