From 6bbb9333cca941cbaf0692deeac9b0500282ec7f Mon Sep 17 00:00:00 2001 From: Alex Date: Sat, 23 Nov 2024 18:27:15 -0500 Subject: [PATCH] thelio76: add nxinit helper --- config/apps/bash/default.nix | 1 + config/apps/bash/nxinit.sh | 49 ++++++++++++++++++++++++++++++++++++ 2 files changed, 50 insertions(+) create mode 100644 config/apps/bash/nxinit.sh 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 +}