auto-update-daily-20260202
  1# Home-manager configuration for microVM guests
  2#
  3# Provides shell setup, git config, and development tools for Claude Code agents
  4{
  5  pkgs,
  6  extraPackages ? [ ],
  7}:
  8{ config, ... }:
  9{
 10  home.stateVersion = "24.11";
 11  home.username = "vincent";
 12  home.homeDirectory = "/home/vincent";
 13
 14  # Shell configuration - zsh with starship prompt
 15  programs.zsh = {
 16    enable = true;
 17    dotDir = "${config.xdg.configHome}/zsh"; # Use XDG config directory
 18    autosuggestion.enable = true;
 19    enableCompletion = true;
 20    syntaxHighlighting.enable = true;
 21    history = {
 22      size = 10000;
 23      save = 10000;
 24      share = true;
 25      ignoreDups = true;
 26      ignoreSpace = true;
 27    };
 28    shellAliases = {
 29      ll = "eza -la";
 30      la = "eza -a";
 31      l = "eza -l";
 32      ls = "eza";
 33      cat = "bat";
 34      g = "git";
 35      gs = "git status";
 36      gd = "git diff";
 37      gc = "git commit";
 38      gp = "git push";
 39      gl = "git log --oneline -20";
 40    };
 41    initContent = ''
 42      # Start in workspace
 43      cd /workspace 2>/dev/null || true
 44
 45      # Claude Code convenience
 46      alias cc="claude --dangerously-skip-permissions"
 47    '';
 48  };
 49
 50  programs.starship = {
 51    enable = true;
 52    enableZshIntegration = true;
 53    settings = {
 54      add_newline = true;
 55      format = "$hostname$directory$git_branch$git_status$nix_shell$character";
 56      hostname = {
 57        ssh_only = false;
 58        format = "[$hostname]($style) ";
 59        style = "bold cyan";
 60      };
 61      directory = {
 62        truncation_length = 3;
 63        truncate_to_repo = true;
 64      };
 65      git_branch = {
 66        format = "[$branch]($style) ";
 67        style = "bold purple";
 68      };
 69      character = {
 70        success_symbol = "[>](bold green)";
 71        error_symbol = "[>](bold red)";
 72      };
 73      nix_shell = {
 74        format = "[$symbol$state]($style) ";
 75        symbol = " ";
 76      };
 77    };
 78  };
 79
 80  # Git configuration (using new option names per home-manager 26.05)
 81  programs.git = {
 82    enable = true;
 83    signing = {
 84      key = null; # No GPG in VMs
 85      signByDefault = false;
 86    };
 87    settings = {
 88      user.name = "Vincent Demeester";
 89      user.email = "vincent@sbr.pm";
 90      init.defaultBranch = "main";
 91      pull.rebase = true;
 92      push.autoSetupRemote = true;
 93      core.editor = "vim";
 94      diff.algorithm = "histogram";
 95      merge.conflictstyle = "zdiff3";
 96      rerere.enabled = true;
 97      # Safe directory for workspace
 98      safe.directory = "/workspace";
 99    };
100  };
101
102  # Delta for git diffs
103  programs.delta = {
104    enable = true;
105    enableGitIntegration = true;
106    options = {
107      navigate = true;
108      line-numbers = true;
109      syntax-theme = "Monokai Extended";
110    };
111  };
112
113  # Tmux for session persistence
114  programs.tmux = {
115    enable = true;
116    clock24 = true;
117    keyMode = "vi";
118    terminal = "screen-256color";
119    historyLimit = 50000;
120    extraConfig = ''
121      set -g mouse on
122      set -g status-style 'bg=#333333 fg=#ffffff'
123      set -g status-left '[#S] '
124      set -g status-right '%H:%M'
125
126      # Better splits
127      bind | split-window -h -c "#{pane_current_path}"
128      bind - split-window -v -c "#{pane_current_path}"
129    '';
130  };
131
132  # FZF for fuzzy finding
133  programs.fzf = {
134    enable = true;
135    enableZshIntegration = true;
136    defaultOptions = [
137      "--height 40%"
138      "--layout=reverse"
139      "--border"
140    ];
141  };
142
143  # Direnv for per-project environments
144  programs.direnv = {
145    enable = true;
146    enableZshIntegration = true;
147    nix-direnv.enable = true;
148  };
149
150  # Development tools
151  home.packages =
152    with pkgs;
153    [
154      # Core tools
155      ripgrep
156      fd
157      bat
158      eza
159      jq
160      yq-go
161      tree
162      htop
163      curl
164      wget
165
166      # Git tools
167      delta
168      gh
169      lazygit
170
171      # Nix tools
172      nixfmt
173      deadnix
174      nil # Nix LSP
175
176      # Claude Code (from nixpkgs-master via overlay)
177      master.claude-code
178
179      # Build tools
180      gnumake
181    ]
182    ++ extraPackages;
183
184  # XDG directories
185  xdg.enable = true;
186
187  # Environment variables
188  home.sessionVariables = {
189    EDITOR = "vim";
190    VISUAL = "vim";
191    PAGER = "less -FR";
192    # Claude reads config from shared mount
193    CLAUDE_CONFIG_DIR = "/home/vincent/.claude";
194  };
195}