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

@@ -6,6 +6,14 @@
# 1Password SSH Socket
environment.variables.SSH_AUTH_SOCK = "~/Library/Group Containers/2BU8OCWD5C.com.1password/t/agent.sock";
# Set vim as default editor
environment.variables.EDITOR = "vim";
environment.variables.VISUAL = "vim";
environment.variables.GIT_EDITOR = "vim";
# Add Homebrew to PATH
environment.systemPath = [ "/opt/homebrew/bin" "/opt/homebrew/sbin" ];
system.primaryUser = "matthew.bessette";
users.users."matthew.bessette" = {
name = "matthew.bessette";
@@ -13,11 +21,19 @@
};
# Homebrew for Casks and specific binaries
# In a nix-darwin setup, Homebrew packages are not actually stored inside the Nix store.
# Instead, nix-darwin acts as a manager that triggers the standard Homebrew installation
# process on your macOS system.
homebrew = {
enable = true;
onActivation.cleanup = "uninstall";
onActivation.autoUpdate = true;
onActivation.upgrade = true;
taps = [ "bufbuild/buf" "jacobjohansen/tap" ];
brews = [ "jacobjohansen/tap/rds-auth-proxy"];
brews = [
"biome"
"jacobjohansen/tap/rds-auth-proxy"
];
casks = [
"android-commandlinetools"
"android-platform-tools"
@@ -27,7 +43,6 @@
"signal"
"spotify"
"yubico-yubikey-manager"
"visual-studio-code"
"zoom"
];
};

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 = {

22
config/biome.json Normal file
View File

@@ -0,0 +1,22 @@
{
"$schema": "https://biomejs.dev/schemas/2.4.5/schema.json",
"organizeImports": {
"enabled": true
},
"formatter": {
"enabled": true,
"formatWithErrors": false,
"indentStyle": "space",
"indentWidth": 2,
"lineWidth": 140,
"attributePosition": "auto"
},
"javascript": {
"formatter": {
"quoteStyle": "single",
"jsxQuoteStyle": "double",
"trailingCommas": "all",
"arrowParentheses": "asNeeded"
}
}
}

View File

@@ -0,0 +1,47 @@
{
"$schema": "vscode://schemas/settings/user",
"editor.tabSize": 2,
"editor.unicodeHighlight.ambiguousCharacters": false,
"editor.unicodeHighlight.invisibleCharacters": false,
"editor.formatOnSave": true,
"editor.defaultFormatter": "biomejs.biome",
"debug.javascript.autoAttachFilter": "disabled",
"[json]": {
"editor.defaultFormatter": "biomejs.biome",
"editor.formatOnSave": true
},
"[jsonc]": {
"editor.defaultFormatter": "biomejs.biome",
"editor.formatOnSave": true
},
"[javascript]": {
"editor.defaultFormatter": "biomejs.biome",
"editor.codeActionsOnSave": {
"source.organizeImports": "explicit"
}
},
"[typescript]": {
"editor.defaultFormatter": "biomejs.biome",
"editor.codeActionsOnSave": {
"source.organizeImports": "explicit"
}
},
"js/ts.updateImportsOnPaste.enabled": true,
"js/ts.preferences.importModuleSpecifier": "relative",
"git.openRepositoryInParentFolders": "never",
"github.copilot.nextEditSuggestions.enabled": true,
"chat.tools.terminal.autoApprove": { "yarn test": true, "npm test": true },
"gitlens.ai.model": "vscode",
"gitlens.ai.vscode.model": "copilot:gpt-4.1",
"chat.viewSessions.orientation": "stacked",
"json.schemaDownload.trustedDomains": {
"https://schemastore.azurewebsites.net/": true,
"https://raw.githubusercontent.com/microsoft/vscode/": true,
"https://raw.githubusercontent.com/devcontainers/spec/": true,
"https://www.schemastore.org/": true,
"https://json.schemastore.org/": true,
"https://json-schema.org/": true,
"https://developer.microsoft.com/json-schemas/": true,
"https://biomejs.dev": true
}
}

View File

@@ -82,6 +82,7 @@
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.users."matthew.bessette" = import ./_hosts/cleo-darwin/home.nix;
home-manager.backupFileExtension = ".before-nix";
}
];
};