From 601ea385d16f821aab39027c06ba702b36341746 Mon Sep 17 00:00:00 2001 From: Rafal Gwozdzinski Date: Fri, 3 Feb 2023 04:13:06 +0100 Subject: [PATCH] Add funny joke to shell hook example --- nix/shell/example.nix | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/nix/shell/example.nix b/nix/shell/example.nix index 1c6e5049..fe5a90f9 100644 --- a/nix/shell/example.nix +++ b/nix/shell/example.nix @@ -1,19 +1,20 @@ { pkgs }: +let + joke = { FUNNY_JOKE = "What kind of phone does a turtle use? A shell phone!"; }; +in { - example = pkgs.mkShell { + example = pkgs.mkShell (joke // { packages = with pkgs; [ curl jq git ]; + }); - FUNNY_JOKE = "What kind of phone does a turtle use? A shell phone!"; - }; - - hook = pkgs.mkShell { + hook = pkgs.mkShell (joke // { shellHook = '' echo "Congrats! You just triggered a shell hook for a Nix development environment." echo "Run \"exit\" to exit this environment." echo "Then run \"nix develop github:DeterminateSystems/zero-to-nix#hook\" again to re-trigger this hook." ''; - }; + }); cpp = pkgs.mkShell { packages = with pkgs; [ gcc cmake ];