{ config, lib, pkgs, hostname, userConfig, ... }: let onePassPath = if pkgs.stdenv.isDarwin then "${userConfig.homeDirectory}/Library/Group Containers/2BUA8C4S2C.com.1password/t/agent.sock" else "${userConfig.homeDirectory}/.1password/agent.sock"; ghosttyPkg = if pkgs.stdenv.isDarwin then pkgs."ghostty-bin" else pkgs.ghostty; in { home.stateVersion = lib.mkDefault "26.05"; home.username = userConfig.username; home.homeDirectory = userConfig.homeDirectory; home.sessionVariables.SSH_AUTH_SOCK = onePassPath; home.sessionVariables.CLAUDE_CONFIG_DIR = "${config.xdg.configHome}/claude"; xdg.enable = true; xdg.configFile."ssh.conf".source = ./config.ssh.conf; xdg.configFile."claude/settings.json".source = ./config.claude.json; xdg.configFile."1Password/ssh/agent.toml".text = '' [[ssh-keys]] item = "${userConfig._1PassKeyName}" vault = "${userConfig._1PassKeyVault}" ''; programs.zsh = { enable = true; enableCompletion = true; autosuggestion.enable = true; syntaxHighlighting.enable = true; shellAliases = { ll = "ls -l"; gst = "git status"; nix-update = "sudo nixos-rebuild switch --flake ~/nixos#${hostname}"; home-update = "home-manager switch --flake ~/nixos#${userConfig.username}@${hostname}"; }; }; programs.starship = { enable = true; enableZshIntegration = true; # Optional custom settings (translates to ~/.config/starship.toml) settings = { # Line 1: ➜ folder git:(branch) [status] format = "$character$directory$git_branch\${custom.git_dirty} "; # Show current directory name only directory = { style = "bold cyan"; truncation_length = 1; truncate_to_repo = false; }; # git:(branch) styling git_branch = { format = "[git:\\([$branch](red)\\)](bold blue)"; }; # Bottom line prompt arrow character = { success_symbol = "[➜](bold green)"; error_symbol = "[➜](bold red)"; vicmd_symbol = "[➜](bold yellow)"; }; custom.git_dirty = { when = "test -n \"$(git status --porcelain 2>/dev/null)\""; format = " [✘](yellow)"; }; # Nix shell indicator module configuration nix_shell = { symbol = "❄️ "; format = "via [$symbol$state]($style) "; }; }; }; programs.ssh = { enable = true; enableDefaultConfig = false; extraConfig = builtins.readFile ./config.ssh.conf; settings = { "*" = { ControlMaster = "auto"; ControlPath = "~/.ssh/master-%r@%h:%p"; IdentityAgent = "\"${onePassPath}\""; }; }; }; programs.git = { enable = true; settings = { user.name = userConfig.gitName; user.email = userConfig.gitEmail; init.defaultBranch = "main"; pull.rebase = false; core.sshCommand = "ssh"; }; }; programs.ghostty = { enable = true; package = ghosttyPkg; enableBashIntegration = true; enableZshIntegration = true; }; }