diff --git a/config/apps/bash/default.nix b/config/apps/bash/default.nix index c305f06..2023426 100644 --- a/config/apps/bash/default.nix +++ b/config/apps/bash/default.nix @@ -4,6 +4,7 @@ enable = true; bashrcExtra = '' ${builtins.readFile ./nxr.sh} + ${builtins.readFile ./nxinit.sh} eval "$(direnv hook bash)" ''; diff --git a/config/apps/bash/nxinit.sh b/config/apps/bash/nxinit.sh new file mode 100644 index 0000000..06a4ad8 --- /dev/null +++ b/config/apps/bash/nxinit.sh @@ -0,0 +1,49 @@ +# shellcheck disable=SC2148 +function nxinit() { + set -u + + if [ ! -f ".envrc" ]; then + cat >.envrc <flake.nix <>.gitignore + fi +}