bundlewrap/bundles/zsh/items.py
CroneKorkN f3122f3d0a
refactor(zsh): replace oh-my-zsh with a hand-rolled zprofile
Drops both git_deploy clones (ohmyzsh, zsh-autosuggestions), the chown
action, the bw.zsh-theme, and the plugin directories. /etc/zsh/zprofile
now embeds a compact prompt mirroring the old theme's colors (no git
segment), sources zsh-autosuggestions from the new apt package, and
binds prefix-history search on the arrow keys.

Per-user ~/.zshrc is kept as a one-line marker so zsh-newuser-install
doesn't fire when ckn logs in.

Leftover /etc/zsh/oh-my-zsh/ trees aren't removed automatically — clean
once with `bw run linux 'rm -rf /etc/zsh/oh-my-zsh'` after the next
fleet-wide apply.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-16 01:00:07 +02:00

19 lines
666 B
Python

from os.path import join
files = {
'/etc/zsh/zprofile': {
'mode': '0644',
},
}
# Empty stub in each zsh user's home. zsh-newuser-install fires on login
# when none of ~/.{zshrc,zshenv,zprofile,zlogin} exists, and the real
# config lives in /etc/zsh/zprofile — so we keep a one-line marker file
# here to suppress the new-user wizard.
for name, user_config in node.metadata.get('users').items():
if user_config.get('shell', None) == '/usr/bin/zsh':
files[join(user_config['home'], '.zshrc')] = {
'owner': name,
'group': name,
'content': '# bw managed; real config in /etc/zsh/zprofile\n',
}