about summary refs log tree commit diff
path: root/third_party/nix/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'third_party/nix/default.nix')
-rw-r--r--third_party/nix/default.nix13
1 files changed, 13 insertions, 0 deletions
diff --git a/third_party/nix/default.nix b/third_party/nix/default.nix
index a5f2e5bd7677..db33a1429bee 100644
--- a/third_party/nix/default.nix
+++ b/third_party/nix/default.nix
@@ -131,6 +131,19 @@ in lib.fix (self: pkgs.llvmPackages.libcxxStdenv.mkDerivation {
 
     mkdir -p $out/libexec/nix
     ln -s $out/bin/nix $out/libexec/nix/build-remote
+
+    # configuration variables for templated files
+    export storedir=/nix/store
+    export localstatedir=/nix/var/nix
+    export bindir=$out/bin
+
+    mkdir -p $out/lib/systemd/system
+    substituteAll \
+      ${src}/misc/systemd/nix-daemon.service.in \
+      $out/lib/systemd/system/nix-daemon.service
+    substituteAll \
+      ${src}/misc/systemd/nix-daemon.socket.in \
+      $out/lib/systemd/system/nix-daemon.socket
   '';
 
   # TODO(tazjin): integration test setup?