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 # 1Password SSH Socket
environment.variables.SSH_AUTH_SOCK = "~/Library/Group Containers/2BU8OCWD5C.com.1password/t/agent.sock"; 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"; system.primaryUser = "matthew.bessette";
users.users."matthew.bessette" = { users.users."matthew.bessette" = {
name = "matthew.bessette"; name = "matthew.bessette";
@@ -13,11 +21,19 @@
}; };
# Homebrew for Casks and specific binaries # 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 = { homebrew = {
enable = true; enable = true;
onActivation.cleanup = "uninstall"; onActivation.cleanup = "uninstall";
onActivation.autoUpdate = true;
onActivation.upgrade = true;
taps = [ "bufbuild/buf" "jacobjohansen/tap" ]; taps = [ "bufbuild/buf" "jacobjohansen/tap" ];
brews = [ "jacobjohansen/tap/rds-auth-proxy"]; brews = [
"biome"
"jacobjohansen/tap/rds-auth-proxy"
];
casks = [ casks = [
"android-commandlinetools" "android-commandlinetools"
"android-platform-tools" "android-platform-tools"
@@ -27,7 +43,6 @@
"signal" "signal"
"spotify" "spotify"
"yubico-yubikey-manager" "yubico-yubikey-manager"
"visual-studio-code"
"zoom" "zoom"
]; ];
}; };

View File

@@ -23,22 +23,34 @@
buf 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) # Managed VS Code Extensions (The "Clean" Way)
programs.vscode = { programs.vscode = {
enable = true; enable = true;
profiles.default = { profiles.default = {
userSettings = builtins.fromJSON (builtins.readFile ../../config/vscode.settings.json);
extensions = with pkgs.vscode-extensions; [ extensions = with pkgs.vscode-extensions; [
ms-python.python # graphql.vscode-graphql
ms-python.vscode-pylance biomejs.biome
ms-python.debugpy bbenoist.nix
hashicorp.terraform
esbenp.prettier-vscode
dbaeumer.vscode-eslint dbaeumer.vscode-eslint
eamodio.gitlens eamodio.gitlens
redhat.vscode-xml esbenp.prettier-vscode
graphql.vscode-graphql-syntax
hashicorp.terraform
mechatroner.rainbow-csv mechatroner.rainbow-csv
bbenoist.nix # mermaidchart.vscode-mermaid-chart
# Note: Some niche extensions might need to be installed manually in VS Code ms-python.debugpy
ms-python.python
ms-python.vscode-pylance
redhat.vscode-xml
]; ];
}; };
}; };
@@ -58,6 +70,19 @@
initContent = '' initContent = ''
export SSH_AUTH_SOCK=~/Library/Group\ Containers/2BU8OCWD5C.com.1password/t/agent.sock 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 = { 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.useGlobalPkgs = true;
home-manager.useUserPackages = true; home-manager.useUserPackages = true;
home-manager.users."matthew.bessette" = import ./_hosts/cleo-darwin/home.nix; home-manager.users."matthew.bessette" = import ./_hosts/cleo-darwin/home.nix;
home-manager.backupFileExtension = ".before-nix";
} }
]; ];
}; };