Move Zed config to Ansible template with 1Password secrets
Some checks failed
Ansible Lint Check / check-ansible (push) Successful in 4s
Nix Format Check / check-format (push) Successful in 1m7s
Python Lint Check / check-python (push) Failing after 6s

This commit is contained in:
2025-09-24 16:10:44 +02:00
parent e5723e0964
commit d33f367c5f
4 changed files with 41 additions and 4 deletions

View File

@@ -6,10 +6,6 @@
- name: Define workstation symlinks
ansible.builtin.set_fact:
workstation_symlinks:
- {
src: "$DOTFILES_PATH/config/zed.jsonc",
dest: "~/.config/zed/settings.json",
}
- { src: "$DOTFILES_PATH/config/autostart", dest: "~/.config/autostart" }
- name: Ensure parent directories for workstation symlinks exist

View File

@@ -4,6 +4,9 @@
- name: Include workstation symlinks tasks
ansible.builtin.import_tasks: tasks/workstations/symlinks.yml
- name: Include Zed configuration tasks
ansible.builtin.import_tasks: tasks/workstations/zed.yml
- name: Include workstation cliphist tasks
ansible.builtin.import_tasks: tasks/workstations/cliphist.yml
when: "'microsoft-standard-WSL2' not in ansible_kernel"

View File

@@ -0,0 +1,20 @@
---
- name: Zed Configuration
block:
- name: Set user home directory
ansible.builtin.set_fact:
user_home: "{{ ansible_env.HOME if ansible_user_id == 'root' else lookup('env', 'HOME') }}"
- name: Ensure Zed config directory exists
ansible.builtin.file:
path: "{{ user_home }}/.config/zed"
state: directory
mode: "0755"
- name: Template Zed settings with 1Password secrets
ansible.builtin.template:
src: zed.jsonc.j2
dest: "{{ user_home }}/.config/zed/settings.json"
mode: "0644"
tags:
- zed

View File

@@ -10,6 +10,24 @@
// #############################################
// ## Theming ##
// #############################################
"context_servers": {
"mcp-server-context7": {
"source": "extension",
"enabled": true,
"settings": {
"context7_api_key": "{{ lookup('community.general.onepassword', 'Zed Settings', vault='Dotfiles', field='mcp-server-context7') }}"
}
},
"memory": {
"source": "custom",
"enabled": true,
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-memory"],
"env": {
"MEMORY_FILE_PATH": "${input:memory_file_path}"
}
}
},
"features": {
"edit_prediction_provider": "copilot"
},