From 7c56fccdad85c5d99c1a79e0768ce3d20aac82e9 Mon Sep 17 00:00:00 2001 From: Griffin Smith Date: Fri, 24 Jul 2020 22:47:12 -0400 Subject: feat(3p/nix): Template systemd unit files in build 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 Reviewed-by: tazjin --- third_party/nix/default.nix | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'third_party') 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? -- cgit 1.4.1