about summary refs log tree commit diff
diff options
context:
space:
mode:
authorGriffin Smith <grfn@gws.fyi>2020-08-30T16·33-0400
committerglittershark <grfn@gws.fyi>2020-08-30T16·39+0000
commit1c64930e9fe7f20c0312057f82e3fb66e568f845 (patch)
tree30727172999e0e6bd65d89cd0bae5ba474ba8752
parent1ab6e658af2e7eead26c25c612deaa0d0aaf70bd (diff)
feat(tvix): Install profile scripts into the output r/1739
The nix package is expected to install /etc/profile.d/nix.sh and
/etc/profile.d/nix-daemon.sh into its output - these set the environment
variables expected by the client-side nix user commands, eg NIX_DAEMON.

Fixes: b/52
Change-Id: I5fb964c076f092d0ef7e1d49aca37875c866fb90
Reviewed-on: https://cl.tvl.fyi/c/depot/+/1889
Reviewed-by: tazjin <mail@tazj.in>
Tested-by: BuildkiteCI
-rw-r--r--third_party/nix/default.nix6
1 files changed, 6 insertions, 0 deletions
diff --git a/third_party/nix/default.nix b/third_party/nix/default.nix
index fc3ed792e2..5792c30340 100644
--- a/third_party/nix/default.nix
+++ b/third_party/nix/default.nix
@@ -146,6 +146,12 @@ in lib.fix (self: pkgs.llvmPackages.libcxxStdenv.mkDerivation {
     substituteAll \
       ${src}/misc/systemd/nix-daemon.socket.in \
       $out/lib/systemd/system/nix-daemon.socket
+
+    mkdir -p $out/etc/profile.d
+    substituteAll \
+      ${src}/scripts/nix-profile.sh.in $out/etc/profile.d/nix.sh
+    substituteAll \
+      ${src}/scripts/nix-profile-daemon.sh.in $out/etc/profile.d/nix-daemon.sh
   '';
 
   # TODO(tazjin): integration test setup?