223 lines
6.1 KiB
Nix
223 lines
6.1 KiB
Nix
{ config, pkgs, inputs, ... }:
|
||
let
|
||
oldPkgs = import inputs.nixpkgs-nodejs {
|
||
system = pkgs.stdenv.hostPlatform.system;
|
||
config.allowUnfree = true;
|
||
};
|
||
in
|
||
{
|
||
home.stateVersion = "23.11";
|
||
|
||
home.username = "matthew.bessette";
|
||
home.homeDirectory = "/Users/matthew.bessette";
|
||
|
||
home.packages = with pkgs; [
|
||
# Dev Specs
|
||
python3
|
||
pipenv
|
||
|
||
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;
|
||
profiles.default = {
|
||
userSettings = builtins.fromJSON (builtins.readFile ./config.vscode.settings.json);
|
||
extensions = (
|
||
with pkgs.vscode-marketplace-release; [
|
||
bbenoist.nix
|
||
graphql.vscode-graphql-syntax
|
||
graphql.vscode-graphql
|
||
ms-python.debugpy
|
||
ms-python.python
|
||
ms-python.vscode-pylance
|
||
oxc.oxc-vscode
|
||
vscode-icons-team.vscode-icons
|
||
typescriptteam.native-preview
|
||
waderyan.gitblame
|
||
]
|
||
) ++ (
|
||
with pkgs.vscode-marketplace; [
|
||
biomejs.biome
|
||
]
|
||
);
|
||
};
|
||
};
|
||
|
||
programs.starship = {
|
||
enable = true;
|
||
enableZshIntegration = true;
|
||
|
||
settings = {
|
||
add_newline = false;
|
||
character = {
|
||
success_symbol = "[❯](bold green)";
|
||
error_symbol = "[❯](bold red)";
|
||
};
|
||
};
|
||
};
|
||
|
||
# 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";
|
||
};
|
||
};
|
||
|
||
home.sessionVariables = {
|
||
CLAUDE_CONFIG_DIR = "${config.home.homeDirectory}/.config/claude";
|
||
# Points to the Homebrew location mentioned in your caveat
|
||
JAVA_HOME = "/Library/Java/JavaVirtualMachines/zulu-17.jdk/Contents/Home";
|
||
NPM_CONFIG_PREFIX = "${config.home.homeDirectory}/.npm-global";
|
||
GRANTED_ALIAS_CONFIGURED = "true";
|
||
# 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";
|
||
};
|
||
|
||
home.sessionPath = [
|
||
"${config.home.homeDirectory}/.npm-global/bin"
|
||
];
|
||
|
||
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;
|
||
|
||
programs.git = {
|
||
enable = true;
|
||
|
||
settings.user = {
|
||
name = "Matthew Bessette";
|
||
email = "matthew.bessette@hicleo.com";
|
||
};
|
||
|
||
settings.init.defaultBranch = "main";
|
||
|
||
# This creates ~/.config/git/ignore and sets core.excludesFile
|
||
ignores = [
|
||
"biome.json"
|
||
"flake.lock"
|
||
"flake.nix"
|
||
".DS_Store"
|
||
".direnv"
|
||
".envrc"
|
||
];
|
||
};
|
||
} |