summaryrefslogtreecommitdiff
path: root/gnu/services/nix.scm
diff options
context:
space:
mode:
authorMarius Bakke <marius@gnu.org>2022-12-28 01:02:47 +0100
committerMarius Bakke <marius@gnu.org>2022-12-28 01:02:47 +0100
commitec0fbb471dfc6f72796da9ebafbb0630daa91267 (patch)
tree3b42f3d0a6470d85fbb8421179634bb278883e4e /gnu/services/nix.scm
parentf5ef7d34e4deecb80aff585c108b0a2ab1f33ce4 (diff)
parent0cb8f7125b19264b01962c1249c3df4c5ce85aa9 (diff)
Merge branch 'master' into staging
Diffstat (limited to 'gnu/services/nix.scm')
-rw-r--r--gnu/services/nix.scm11
1 files changed, 8 insertions, 3 deletions
diff --git a/gnu/services/nix.scm b/gnu/services/nix.scm
index df04a85c22..82853253f6 100644
--- a/gnu/services/nix.scm
+++ b/gnu/services/nix.scm
@@ -54,6 +54,8 @@
(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 @@ GID."
(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 @@ GID."
(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 @@ GID."
(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)))))))