From 9a737444c4f63d779bbf59c2dcc13df12e506b3a Mon Sep 17 00:00:00 2001 From: YoshiRulz Date: Sun, 9 Jun 2024 16:24:08 +1000 Subject: [PATCH] Nix expr: Mute `shellHook` when running non-interactively --- shell.nix | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/shell.nix b/shell.nix index edcf8a13ca..2ea8cb5880 100644 --- a/shell.nix +++ b/shell.nix @@ -33,11 +33,14 @@ fi alias discohawk-monort-local='${avail.launchScriptsForLocalBuild.discohawk}' alias emuhawk-monort-local='${avail.launchScriptsForLocalBuild.emuhawk}' - pfx="$(realpath --relative-to="$PWD" "$BIZHAWKBUILD_HOME")/" - if [ "$pfx" = "./" ]; then pfx=""; fi - printf "%s\n%s\n" \ - "Run ''${pfx}Dist/Build{Debug,Release}.sh to build the solution. You may need to clean up with ''${pfx}Dist/CleanupBuildOutputDirs.sh." \ - "Once built, running {discohawk,emuhawk}-monort-local will pull from ''${pfx}output/* and use Mono from Nixpkgs." + case "$-" in *i*) + pfx="$(realpath --relative-to="$PWD" "$BIZHAWKBUILD_HOME")/" + if [ "$pfx" = "./" ]; then pfx=""; fi + printf "%s\n%s\n" \ + "Run ''${pfx}Dist/Build{Debug,Release}.sh to build the solution. You may need to clean up with ''${pfx}Dist/CleanupBuildOutputDirs.sh." \ + "Once built, running {discohawk,emuhawk}-monort-local will pull from ''${pfx}output/* and use Mono from Nixpkgs." + ;; + esac ''; }; shells = lib.pipe avail [