From d7f4b096c73e1e39e1d2fb74310948ce54a57ac6 Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Thu, 9 Jul 2026 05:21:40 +0000 Subject: [PATCH] Prompt for machine name at chezmoi init Replace ~/.name content of darwin/linux with promptStringOnce machine_name, defaulting to .chezmoi.hostname. Used by tmux status bar and shell prompts. Co-authored-by: Huy Pham --- .chezmoi.toml.tmpl | 2 ++ dot_name.tmpl | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.chezmoi.toml.tmpl b/.chezmoi.toml.tmpl index f9d36e7..a114fa5 100644 --- a/.chezmoi.toml.tmpl +++ b/.chezmoi.toml.tmpl @@ -1,9 +1,11 @@ {{- $gitName := promptStringOnce . "git_name" "Git user.name for ~/.gitconfig_local" "" -}} {{- $gitEmail := promptStringOnce . "git_email" "Git user.email for ~/.gitconfig_local" "" -}} {{- $githubUser := promptStringOnce . "github_user" "GitHub username for [github] user in ~/.gitconfig_local" "" -}} +{{- $machineName := promptStringOnce . "machine_name" "Machine name for ~/.name (prompts, tmux status)" .chezmoi.hostname -}} mode = "symlink" [data] git_name = {{ $gitName | quote }} git_email = {{ $gitEmail | quote }} github_user = {{ $githubUser | quote }} +machine_name = {{ $machineName | quote }} diff --git a/dot_name.tmpl b/dot_name.tmpl index 128df65..98e974a 100644 --- a/dot_name.tmpl +++ b/dot_name.tmpl @@ -1 +1 @@ -{{ .chezmoi.os }} +{{ (index . "machine_name") | default .chezmoi.hostname }}