Add go devshell

Signed-off-by: Nikolaos Karaolidis <nick@karaolidis.com>
This commit is contained in:
2025-01-06 13:44:43 +02:00
parent 249c089718
commit 31f3364f06
14 changed files with 111 additions and 34 deletions

View File

@@ -19,14 +19,24 @@
initExtra = ''
nix-direnv() {
if [ -z "$1" ]; then
echo "Usage: nix-direnv <shell>"
return 1
echo "use flake" > .envrc
else
echo "use flake self#$1" > .envrc
fi
if git rev-parse --is-inside-work-tree &> /dev/null && ! grep -q "^\.envrc$" .gitignore .git/info/exclude; then
echo "Do you want to hide the .envrc file from git? (y/N)"
read -r answer
if [[ "$answer" =~ ^[Yy]$ ]]; then
echo ".envrc" >> .git/info/exclude
fi
fi
echo "use $1" > .envrc
direnv allow
}
'';
p10k.extraRightPromptElements = [ "direnv" ];
};
};