VSCode life

This commit is contained in:
Matthew Bessette
2026-03-05 15:38:23 -05:00
parent 258ffea293
commit 618595addb
5 changed files with 120 additions and 10 deletions

View File

@@ -23,22 +23,34 @@
buf
];
xdg.configFile."biome.json".source = ../../config/biome.json;
# Enable direnv for automatic environment switching
programs.direnv = {
enable = true;
nix-direnv.enable = true; # Better Nix flakes integration with caching
};
# Managed VS Code Extensions (The "Clean" Way)
programs.vscode = {
enable = true;
profiles.default = {
userSettings = builtins.fromJSON (builtins.readFile ../../config/vscode.settings.json);
extensions = with pkgs.vscode-extensions; [
ms-python.python
ms-python.vscode-pylance
ms-python.debugpy
hashicorp.terraform
esbenp.prettier-vscode
# graphql.vscode-graphql
biomejs.biome
bbenoist.nix
dbaeumer.vscode-eslint
eamodio.gitlens
redhat.vscode-xml
esbenp.prettier-vscode
graphql.vscode-graphql-syntax
hashicorp.terraform
mechatroner.rainbow-csv
bbenoist.nix
# Note: Some niche extensions might need to be installed manually in VS Code
# mermaidchart.vscode-mermaid-chart
ms-python.debugpy
ms-python.python
ms-python.vscode-pylance
redhat.vscode-xml
];
};
};
@@ -58,6 +70,19 @@
initContent = ''
export SSH_AUTH_SOCK=~/Library/Group\ Containers/2BU8OCWD5C.com.1password/t/agent.sock
# Auto-allow direnv for directories with flake.nix
auto_allow_direnv() {
if [[ -f flake.nix ]] && [[ ! -f .envrc ]]; then
echo "use flake" > .envrc
direnv allow
elif [[ -f flake.nix ]] && [[ -f .envrc ]]; then
direnv allow
fi
}
# Run auto-allow when changing directories
chpwd_functions+=(auto_allow_direnv)
'';
shellAliases = {