85b7d25486
Add home-manager managed CLAUDE.md with commit behavior instructions, a /commit slash command for conventional commits workflow, and expand allowed Bash permissions to include nix commands. Remove inline customInstructions in favor of CLAUDE.md file.
284 lines
6.9 KiB
Nix
284 lines
6.9 KiB
Nix
{ config, pkgs, ... }:
|
|
|
|
{
|
|
home.username = "l-wyatt";
|
|
home.homeDirectory = "/home/l-wyatt";
|
|
home.stateVersion = "25.11"; # Don't change after first setup
|
|
|
|
# Packages for this user
|
|
home.packages = with pkgs; [
|
|
kdePackages.kate
|
|
# nvim
|
|
firefox
|
|
git
|
|
zsh
|
|
python3
|
|
nmap
|
|
file
|
|
freerdp
|
|
bitwarden-desktop
|
|
bitwarden-cli
|
|
lunarvim
|
|
minicom
|
|
kicad
|
|
ghostty
|
|
gnomeExtensions.blur-my-shell
|
|
gnomeExtensions.just-perfection
|
|
gnomeExtensions.arc-menu
|
|
];
|
|
|
|
# --------------------------
|
|
# | Hyprland Configuration |
|
|
# --------------------------
|
|
# Set keybinds
|
|
wayland.windowManager.hyprland = {
|
|
enable = true;
|
|
settings = {
|
|
|
|
exec-once = [
|
|
"hyprpaper"
|
|
];
|
|
"$mod" = "SUPER";
|
|
bind = [
|
|
"$mod, Q, exec, konsole"
|
|
"$mod, C, killactive"
|
|
"$mod, M, exit"
|
|
"$mod, F, exec, firefox"
|
|
];
|
|
decoration = {
|
|
rounding = 10;
|
|
blur.enabled = true;
|
|
};
|
|
};
|
|
};
|
|
# Create hyprpaper config
|
|
home.file.".config/hypr/hyprpaper.conf" = {
|
|
text = ''
|
|
preload = ~/Pictures/background.jpg
|
|
wallpaper = eDP-1,~/Pictures/background.jpg
|
|
splash = false
|
|
'';
|
|
force = true;
|
|
};
|
|
|
|
|
|
# Enable Zsh and configure it
|
|
programs.zsh = {
|
|
enable = true;
|
|
oh-my-zsh.enable = true;
|
|
oh-my-zsh.theme = "agnoster";
|
|
initContent = ''
|
|
export SHELL=$(which zsh)
|
|
alias nix-shell='nix-shell --run $SHELL'
|
|
|
|
# Auto-update nixpkgs-unstable (for claude-code) on rebuild
|
|
nixos-rebuild() {
|
|
if [[ "$1" == "switch" || "$1" == "boot" || "$1" == "test" ]]; then
|
|
echo "Updating nixpkgs-unstable for latest Claude Code..."
|
|
nix flake update nixpkgs-unstable --flake /home/l-wyatt/Documents/nixos-configuration
|
|
fi
|
|
command sudo nixos-rebuild "$@" --flake /home/l-wyatt/Documents/nixos-configuration
|
|
}
|
|
|
|
nix() {
|
|
if [[ $1 == "develop" ]]; then
|
|
shift
|
|
command nix develop "$@" -c $SHELL
|
|
else
|
|
command nix "$@"
|
|
fi
|
|
}
|
|
|
|
if [ -n "$NIX_PROJECT_SHELL" ]; then
|
|
PROMPT="($NIX_PROJECT_SHELL)$PROMPT"
|
|
fi
|
|
# Only start tmux if we're in an interactive terminal
|
|
if [ -z "$TMUX" ] && [ "$TERM" != "linux" ]; then
|
|
exec tmux
|
|
fi
|
|
'';
|
|
|
|
};
|
|
# Configure cursor theme
|
|
home.pointerCursor = {
|
|
gtk.enable = true;
|
|
x11.enable = true;
|
|
name = "Adwaita";
|
|
package = pkgs.adwaita-icon-theme;
|
|
size = 24;
|
|
};
|
|
|
|
# Set Ghostty as default terminal
|
|
dconf.settings = {
|
|
"org/gnome/desktop/default-applications/terminal" = {
|
|
exec = "ghostty";
|
|
exec-arg = "";
|
|
};
|
|
};
|
|
|
|
# Manage your git configuration declaratively
|
|
programs.git = {
|
|
enable = true;
|
|
settings = {
|
|
user = {
|
|
name = "0xWheatyz";
|
|
email = "wyatt@leeworks.dev";
|
|
};
|
|
init.defaultBranch = "master";
|
|
push.autoSetupRemote = "true";
|
|
alias.lg = "log --graph --pretty=format:'%C(yellow)%h%Creset -%C(red)%d%Creset %s %Cgreen(%cr)%Creset %C(bold blue)<%an>%Creset' --abbrev-commit";
|
|
};
|
|
};
|
|
|
|
# Enable tmux (terminal multiplexing)
|
|
programs.tmux = {
|
|
enable = true;
|
|
|
|
# Optional: customize tmux settings
|
|
extraConfig = ''
|
|
# Enable mouse support
|
|
set -g mouse on
|
|
|
|
# Start window numbering at 1
|
|
set -g base-index 1
|
|
|
|
# Set terminal colors
|
|
set -g default-terminal "screen-256color"
|
|
'';
|
|
};
|
|
|
|
# Neovim management - using kickstart.nvim via flake
|
|
# Basic fallback config (uncomment if not using the flake)
|
|
#programs.neovim = {
|
|
# enable = true;
|
|
# defaultEditor = true;
|
|
#
|
|
# # Load Lua config inline
|
|
# extraLuaConfig = ''
|
|
# vim.opt.number = true
|
|
# vim.opt.tabstop = 2
|
|
# vim.opt.shiftwidth = 2
|
|
# vim.opt.expandtab = true
|
|
# vim.opt.relativenumber = true
|
|
#
|
|
# require("telescope").setup {}
|
|
# require("nvim-treesitter.configs").setup { highlight = { enable = true } }
|
|
# '';
|
|
#
|
|
# plugins = with pkgs.vimPlugins; [
|
|
# telescope-nvim
|
|
# nvim-treesitter
|
|
# nvim-lspconfig
|
|
# gruvbox
|
|
# ];
|
|
#};
|
|
|
|
# Use kickstart.nvim configuration from flake
|
|
programs.neovim-kickstart.enable = true;
|
|
|
|
# Claude Code configuration
|
|
home.file.".claude/CLAUDE.md" = {
|
|
text = ''
|
|
## Commit Behavior
|
|
|
|
After completing each logical unit of work, use the /commit skill to stage
|
|
and commit changes before proceeding to the next task. Do not batch unrelated
|
|
changes into a single commit. Do not wait to be asked.
|
|
'';
|
|
force = true;
|
|
};
|
|
|
|
home.file.".claude/commands/commit.md" = {
|
|
text = ''
|
|
---
|
|
description: Stage and commit changes as a conventional commit with one logical unit per commit
|
|
---
|
|
|
|
Review the current working tree with `git status` and `git diff --staged` and `git diff`.
|
|
|
|
Then do the following:
|
|
|
|
1. Identify the smallest logical unit of change present. If multiple unrelated changes exist, only stage and commit one unit at a time — leave the rest unstaged.
|
|
|
|
2. Stage only the files (or hunks via `git add -p`) relevant to that logical unit.
|
|
|
|
3. Write a commit message following the Conventional Commits format:
|
|
<type>(<scope>): <description>
|
|
|
|
Types: feat, fix, docs, style, refactor, perf, test, chore, ci
|
|
- scope is optional but use it when the change is clearly scoped to a module, package, or domain
|
|
- description: lowercase, imperative mood, no trailing period, max ~72 chars
|
|
- if the change warrants a body, add it after a blank line
|
|
|
|
4. Run `git commit` with that message. Never use `--no-verify`.
|
|
|
|
5. Report what was committed and what (if anything) remains uncommitted.
|
|
'';
|
|
force = true;
|
|
};
|
|
|
|
home.file.".claude/settings.json" = {
|
|
text = builtins.toJSON {
|
|
permissions = {
|
|
allow = [
|
|
"Edit"
|
|
"Write"
|
|
"Bash(git:*)"
|
|
"Bash(nix-shell:*)"
|
|
"Bash(nix eval:*)"
|
|
"Bash(nix flake check:*)"
|
|
];
|
|
};
|
|
alwaysThinkingEnabled = true;
|
|
includeCoAuthoredBy = false;
|
|
};
|
|
force = true;
|
|
};
|
|
|
|
programs.ssh = {
|
|
enable = true;
|
|
enableDefaultConfig = false;
|
|
matchBlocks = {
|
|
"*" = {
|
|
controlMaster = "auto";
|
|
controlPersist = "1m";
|
|
controlPath = "~/.ssh/cm-%r@%h:%p";
|
|
};
|
|
"vps" = {
|
|
hostname = "45.79.198.105";
|
|
user = "wyatt";
|
|
port = 22;
|
|
};
|
|
|
|
# No terminal access to this machine
|
|
"_JumpHost" = {
|
|
hostname = "localhost";
|
|
port = 2222;
|
|
user = "wyatt";
|
|
proxyJump = "vps";
|
|
};
|
|
"home" = {
|
|
hostname = "10.0.0.20";
|
|
port = 22;
|
|
user = "l-wyatt";
|
|
proxyJump = "_JumpHost";
|
|
};
|
|
"git" = {
|
|
hostname = "10.0.1.10";
|
|
port = 22;
|
|
user = "git";
|
|
};
|
|
};
|
|
|
|
# extraConfig = ''
|
|
# Host *
|
|
# ControlMaster auto
|
|
# ControlPersist 1m
|
|
# ControlPath /tmp/cm-%r@%h:%p
|
|
# '';
|
|
|
|
};
|
|
|
|
}
|
|
|