From 156c7f3e5c2c20116599f184704a8406e5487ac0 Mon Sep 17 00:00:00 2001
From: Tom Prince <tom.prince@private.storage>
Date: Tue, 21 Sep 2021 11:31:12 -0600
Subject: [PATCH] Add help for interactive nix-shell use.

---
 docs/source/dev/README.rst | 2 +-
 shell.nix                  | 2 ++
 tools/default.nix          | 8 ++++++++
 3 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/docs/source/dev/README.rst b/docs/source/dev/README.rst
index 59d09272..14d2de31 100644
--- a/docs/source/dev/README.rst
+++ b/docs/source/dev/README.rst
@@ -49,7 +49,7 @@ To update the version of NixOS we deploy with, run:
 
 .. code: shell
 
-   nix-shell --command 'update-nixpkgs'
+   nix-shell --run 'update-nixpkgs'
 
 That will update ``nixpkgs-2015.json`` to the latest release on the nixos-21.05 channel.
 
diff --git a/shell.nix b/shell.nix
index abfefabf..dd414673 100644
--- a/shell.nix
+++ b/shell.nix
@@ -9,6 +9,8 @@ pkgs.mkShell {
   shellHook = ''
     export NIX_PATH="nixpkgs=${pkgs.path}";
   '';
+  # Run the shellHook from tools
+  inputsFrom = [tools];
   buildInputs = [
     tools
     pkgs.morph
diff --git a/tools/default.nix b/tools/default.nix
index fbc46990..6273dd2b 100644
--- a/tools/default.nix
+++ b/tools/default.nix
@@ -18,6 +18,14 @@ in
 # with there dependencies available.
 pkgs.runCommand "ps_tools" {
   nativeBuildInputs = [ makeWrapper ];
+  shellHook = ''
+    if [[ $- == *i* ]]; then
+      cat <<MOTD
+    Tools (pass --help for details):
+    - update-nixpkgs
+    MOTD
+    fi
+  '';
 } ''
   mkdir -p $out/bin
   # makeWrapper <executable> <wrapperfile> <args>
-- 
GitLab