reduce calls to contentful

This commit is contained in:
Matthew Bessette
2026-07-28 18:56:47 -04:00
parent 3d55a968d0
commit 6598947a52
7 changed files with 203 additions and 265 deletions
+90 -152
View File
@@ -1,4 +1,4 @@
{ config, pkgs, inputs, ... }:
{ config, lib, pkgs, inputs, ... }:
let
oldPkgs = import inputs.nixpkgs-nodejs {
system = pkgs.stdenv.hostPlatform.system;
@@ -6,47 +6,14 @@ let
};
in
{
home.stateVersion = "23.11";
home.username = "matthew.bessette";
home.homeDirectory = "/Users/matthew.bessette";
home.packages = with pkgs; [
# Dev Specs
python3
pipenv
home.packages = with pkgs; [];
opencode
github-copilot-cli
gh
jira-cli-go
# DB
postgresql_16 # pgdump/restore
# CLI Tools from your Brewfile
xz
ffmpeg
earthly
awscli2
buf
# pkg managers
uv
xcodes
## Tooling
fd
granted
ttyd
] ++ [
oldPkgs.nodejs_22
oldPkgs.yarn
];
# Managed VS Code Extensions (The "Clean" Way)
programs.vscode = {
enable = true;
mutableExtensionsDir = false;
profiles.default = {
userSettings = builtins.fromJSON (builtins.readFile ./config.vscode.settings.json);
extensions = (
@@ -70,59 +37,19 @@ in
};
};
programs.starship = {
# mise runtime manager — installed by nix. Zsh integration is disabled
# because `mise activate zsh` registers a precmd hook that re-evaluates the
# environment before every prompt, causing a per-command shell delay.
# Tools still resolve via shims on PATH (see home.sessionPath below); this
# trades away mise's per-directory env-var auto-loading for prompt speed.
programs.mise = {
enable = true;
enableZshIntegration = true;
settings = {
add_newline = false;
character = {
success_symbol = "[](bold green)";
error_symbol = "[](bold red)";
};
};
enableZshIntegration = false;
};
# Automatically load the 1Password agent in your shell
programs.zsh = {
enable = true;
enableCompletion = true;
autosuggestion.enable = true;
syntaxHighlighting.enable = true;
profileExtra = ''
eval "$(/opt/homebrew/bin/brew shellenv)"
'';
initContent = ''
export JIRA_API_TOKEN=$(security find-generic-password -a "$USER" -s "jira-token" -w 2>/dev/null)
export SSH_AUTH_SOCK=~/Library/Group\ Containers/2BUA8C4S2C.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)
eval "$(uv generate-shell-completion zsh)"
eval "$(uvx --generate-shell-completion zsh)"
'';
shellAliases = {
ll = "ls -l";
gst = "git status";
update = "sudo darwin-rebuild switch --flake ~/nixos#cleo-darwin";
laws = "aws --endpoint=http://localhost:4566";
dev = "nix develop -c $SHELL";
nixos = "code ~/nixos";
assume = "source assume";
};
programs.zsh.shellAliases = {
laws = "aws --endpoint=http://localhost:4566";
assume = "source $(brew --prefix)/bin/assume";
};
home.sessionVariables = {
@@ -134,90 +61,101 @@ in
# Stub SDK root so tools that require ANDROID_HOME/platform-tools/adb work
# even though adb is managed by Homebrew (android-platform-tools cask).
ANDROID_HOME = "${config.home.homeDirectory}/android-sdk";
# Runtime lookup from Apple Keychain — only the command, not the token, is in the store.
JIRA_API_TOKEN = ''$(security find-generic-password -a "$USER" -s jira-token -w 2>/dev/null)'';
# Parity with the ANSIBLE MANAGED BLOCKs the playbook writes to ~/.zshrc.
DOCKER_CLI_HINTS = "false";
GRANTED_ENABLE_AUTO_REASSUME = "true";
COPILOT_OTEL_ENABLED = "true";
COPILOT_OTEL_EXPORTER_TYPE = "file";
# Timestamped per session, like the ansible line (command substitution is intentional).
COPILOT_OTEL_FILE_EXPORTER_PATH = ''$HOME/.copilot/otel/copilot-otel-$(date +%Y%m%d-%H%M%S).jsonl'';
};
home.sessionPath = [
"${config.home.homeDirectory}/.npm-global/bin"
"${config.home.homeDirectory}/.local/share/mise/shims"
];
# git credential.helper=osxkeychain (parity with tasks/git.yml). Darwin-only, so
# it lives here rather than in the cross-platform home.shared.nix.
programs.git.settings.credential.helper = "osxkeychain";
home.file.".npmrc".text = ''
prefix=${config.home.homeDirectory}/.npm-global
'' ;
programs.ghostty = {
enable = true;
# Automatically hooks shell history, title updates, and cwd tracking
enableBashIntegration = true;
enableZshIntegration = true;
enableFishIntegration = true;
settings = {
# Visuals & Theme
theme = "catppuccin-mocha";
font-family = "JetBrainsMono Nerd Font";
font-size = 12;
# Window Spacing
window-padding-x = 12;
window-padding-y = 12;
window-padding-balance = true;
# UI Preferences
window-decoration = true; # Set to false if using a tiling window manager (Hyprland/i3)
gtk-single-instance = true;
confirm-close-surface = false; # Don't prompt when closing a pane
# Cursor Customization
cursor-style = "block";
cursor-style-blink = false;
# Mouse & Scrolling
mouse-hide-while-typing = true;
scrollback-limit = 10000;
# Keybindings (Alt/Super splits & tabs)
keybind = [
"alt+shift+e=new_split:right"
"alt+shift+o=new_split:down"
"alt+w=close_surface"
"alt+t=new_tab"
"alt+1=goto_tab:1"
"alt+2=goto_tab:2"
"alt+3=goto_tab:3"
];
};
};
home.file.".config/1Password/ssh/agent.toml".source = ./config.agent.toml;
# Stub Android SDK directory so ANDROID_HOME/platform-tools/adb resolves to
# the adb binary installed by the android-platform-tools Homebrew cask.
home.file."android-sdk/platform-tools/adb".source = config.lib.file.mkOutOfStoreSymlink "/opt/homebrew/bin/adb";
home.file."android-sdk/cmdline-tools/latest/bin/sdkmanager".source = config.lib.file.mkOutOfStoreSymlink "/opt/homebrew/bin/sdkmanager";
xdg.configFile."opencode/opencode.jsonc".source = config.lib.file.mkOutOfStoreSymlink "/Users/matthew.bessette/nixos/config.opencode.jsonc";
xdg.configFile."oxlint/oxlintrc.json".source = config.lib.file.mkOutOfStoreSymlink "/Users/matthew.bessette/nixos/config.oxlintrc.json";
xdg.configFile."biome/biome.json".source = config.lib.file.mkOutOfStoreSymlink "/Users/matthew.bessette/nixos/config.biome.json";
programs.tmux.enable = true;
# --- Tool config parity with local-dev-ansible (tasks/config/*) ---
# Note: ~/.aws/config is intentionally NOT managed here — `aws-sso-util configure
# populate` must rewrite it at runtime, which a read-only nix symlink would block.
# Run once after switch:
# aws-sso-util configure populate \
# --sso-start-url https://d-9067516d20.awsapps.com/start \
# --sso-region us-east-1 --region us-east-1 --config-default output=json
programs.git = {
enable = true;
settings.user = {
name = "Matthew Bessette";
email = "matthew.bessette@hicleo.com";
# GitHub Copilot CLI (tasks/config/copilot.yml)
home.file.".copilot/settings.json".text = builtins.toJSON {
footer = {
showModelEffort = true;
showBranch = true;
showDirectory = true;
showContextWindow = true;
showQuota = true;
showAgent = true;
};
settings.init.defaultBranch = "main";
# This creates ~/.config/git/ignore and sets core.excludesFile
ignores = [
"biome.json"
"flake.lock"
"flake.nix"
".DS_Store"
".direnv"
".envrc"
];
};
# opencode (tasks/config/opencode.yml)
xdg.configFile."opencode/opencode.json".text = builtins.toJSON {
"$schema" = "https://opencode.ai/config.json";
model = "github-copilot/gpt-5.4";
plugin = [ "@slkiser/opencode-quota" ];
autoupdate = false;
};
xdg.configFile."opencode/tui.json".text = builtins.toJSON {
"$schema" = "https://opencode.ai/tui.json";
plugin = [ "@slkiser/opencode-quota" ];
};
xdg.configFile."opencode/opencode-quota/quota-toast.json".text = builtins.toJSON {
enabledProviders = "auto";
percentDisplayMode = "used";
enableToast = false;
tuiCompactStatus.enabled = false;
tuiSidebarPanel.enabled = true;
maintainerAnnouncements = { enabled = false; home = false; };
};
# Claude Code settings (tasks/config/claude-code.yml) — cleo-scoped override of the
# shared config.claude.json, since claude-statusline is only installed on cleo.
# mkForce wins over home.shared.nix's `.source = ./config.claude.json`.
xdg.configFile."claude/settings.json".source = lib.mkForce (pkgs.writeText "claude-settings.json" (builtins.toJSON {
"$schema" = "https://json.schemastore.org/claude-code-settings.json";
theme = "dark";
agent = "plan";
denyCommands = [ "code --install-extension*" ];
additionalDirectories = [ "/tmp" ];
autoMemoryEnabled = false;
effortLevel = "medium";
fastModePerSessionOptIn = true;
feedbackSurveyRate = 0;
model = "opusplan";
showClearContextOnPlanAccept = false;
statusLine = { type = "command"; command = "claude-statusline prompt"; };
}));
xdg.configFile."claude-statusline/config.toml".text = ''
format = "$directory | $git_branch | $model | $cost | $context | $usage"
preset = "default"
[usage]
disabled = false
format = 'S: {{printf "%.0f" .BlockPct}}% ({{.BlockResets}}) | W: {{printf "%.0f" .WeeklyPct}}%'
'';
}