about summary refs log tree commit diff
path: root/third_party
diff options
context:
space:
mode:
authorGriffin Smith <grfn@gws.fyi>2020-07-25T02·47-0400
committerglittershark <grfn@gws.fyi>2020-07-25T14·12+0000
commit7c56fccdad85c5d99c1a79e0768ce3d20aac82e9 (patch)
tree27d7125fde56eb5db37cbd6ace8ee3a590ab9fd6 /third_party
parent2ed077810303d4476a572229260d5c45ca5f1290 (diff)
feat(3p/nix): Template systemd unit files in build r/1471
Template the systemd unit file templates as part of the nix
installPhase, putting them in the same place that the upstream nix
derivation does.

Change-Id: I3ceabfc0c837564e33b9ae7f9eeb7185d6fbe907
Reviewed-on: https://cl.tvl.fyi/c/depot/+/1429
Tested-by: BuildkiteCI
Reviewed-by: isomer <isomer@tvl.fyi>
Reviewed-by: tazjin <mail@tazj.in>
Diffstat (limited to 'third_party')
-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?