makeShell: make the help msg a shell derivation variable
- The message is now a nix string, which simplifies formatting. - The message can be now be modified via overrideAttrs in client shells. This is more effective than changing the message in Bash.
This commit is contained in:
parent
3f844c06f0
commit
a5730eb736
@ -12,6 +12,31 @@ in
|
|||||||
pkgs.stdenv.mkDerivation {
|
pkgs.stdenv.mkDerivation {
|
||||||
name = "nix-bitcoin-environment";
|
name = "nix-bitcoin-environment";
|
||||||
|
|
||||||
|
helpMessage = ''
|
||||||
|
nix-bitcoin path: ${toString ../.}
|
||||||
|
|
||||||
|
Available commands
|
||||||
|
==================
|
||||||
|
deploy
|
||||||
|
Run krops-deploy and eval-config in parallel.
|
||||||
|
This ensures that eval failures appear quickly when deploying.
|
||||||
|
In this case, deployment is stopped.
|
||||||
|
|
||||||
|
krops-deploy
|
||||||
|
Deploy your node via krops
|
||||||
|
|
||||||
|
eval-config
|
||||||
|
Evaluate your node system configuration
|
||||||
|
|
||||||
|
generate-secrets
|
||||||
|
Create secrets required by your node configuration.
|
||||||
|
Secrets are written to ./secrets/
|
||||||
|
This function is automatically called by krops-deploy.
|
||||||
|
|
||||||
|
update-nix-bitcoin
|
||||||
|
Fetch and use the latest version of nix-bitcoin
|
||||||
|
'';
|
||||||
|
|
||||||
shellHook = ''
|
shellHook = ''
|
||||||
export NIX_PATH="nixpkgs=${nixpkgs}:nix-bitcoin=${toString ../.}:."
|
export NIX_PATH="nixpkgs=${nixpkgs}:nix-bitcoin=${toString ../.}:."
|
||||||
${path}
|
${path}
|
||||||
@ -22,31 +47,10 @@ pkgs.stdenv.mkDerivation {
|
|||||||
# 2. the shell is interactive
|
# 2. the shell is interactive
|
||||||
if [[ -t 1 && $- == *i* ]]; then isInteractive=1; else isInteractive=; fi
|
if [[ -t 1 && $- == *i* ]]; then isInteractive=1; else isInteractive=; fi
|
||||||
|
|
||||||
nixBitcoinHelp() {
|
# Make this a non-environment var
|
||||||
echo "nix-bitcoin path: ${toString ../.}"
|
export -n helpMessage
|
||||||
echo
|
|
||||||
echo "Available commands"
|
help() { echo "$helpMessage"; }
|
||||||
echo "=================="
|
|
||||||
echo "deploy"
|
|
||||||
echo " Run krops-deploy and eval-config in parallel."
|
|
||||||
echo " This ensures that eval failures appear quickly when deploying."
|
|
||||||
echo " In this case, deployment is stopped."
|
|
||||||
echo
|
|
||||||
echo "krops-deploy"
|
|
||||||
echo " Deploy your node via krops"
|
|
||||||
echo
|
|
||||||
echo "eval-config"
|
|
||||||
echo " Evaluate your node system configuration"
|
|
||||||
echo
|
|
||||||
echo "generate-secrets"
|
|
||||||
echo " Create secrets required by your node configuration."
|
|
||||||
echo " Secrets are written to ./secrets/"
|
|
||||||
echo " This function is automatically called by krops-deploy."
|
|
||||||
echo
|
|
||||||
echo "update-nix-bitcoin"
|
|
||||||
echo " Fetch and use the latest version of nix-bitcoin"
|
|
||||||
}
|
|
||||||
help() { nixBitcoinHelp; }
|
|
||||||
h() { help; }
|
h() { help; }
|
||||||
|
|
||||||
fetch-release() {
|
fetch-release() {
|
||||||
|
Loading…
Reference in New Issue
Block a user