| name | managing-vscode |
| description | Manage VSCode via Nix Home Manager: extensions, settings, keybindings, file associations.
Use for VSCode-explicit queries: installing/searching extensions (open-vsx, marketplace),
editing settings.json or keybindings.json, nixd LSP setup for .nix autocompletion, resolving
settings conflicts after nrs, default app associations (duti) for file double-click behavior,
and VSCode snippets.
Generic '에디터' / '편집기' / '코드 편집기' queries route to configuring-neovim by default
(project's primary editor) — invoke this skill only when the request explicitly references
VSCode or one of the VSCode-specific keywords below.
Trigger: 'VSCode', 'vscode', 'settings.json' (in VSCode context), 'keybindings.json',
'nix-ide', 'open-vsx', 'vscode-marketplace', 'VSCode 확장', 'VSCode 확장 프로그램',
'VSCode 스니펫', 'VSCode duti', 'VSCode 키바인딩'.
NOT for Neovim/LazyVim (use configuring-neovim — this is the default editor skill).
|
VSCode 관리
VSCode 에디터의 확장, 설정, 파일 연결을 Nix(Home Manager programs.vscode 모듈)로 선언적 관리하는 가이드.
목적과 범위
VSCode 앱과 확장은 HM programs.vscode 모듈로 설치하고, settings/keybindings는 mkOutOfStoreSymlink으로 양방향 관리한다.
GUI에서의 확장 설치/제거는 불가능하며(mutableExtensionsDir = false), 모든 변경은 Nix 설정을 통해야 한다.
빠른 참조
파일 구조
modules/darwin/programs/vscode/
├── default.nix # 확장 목록, HM 모듈, duti 설정
└── files/
├── settings.json # → ~/Library/.../Code/User/settings.json
└── keybindings.json # → ~/Library/.../Code/User/keybindings.json
~/Applications/Home Manager Apps/
└── Visual Studio Code.app # HM이 자동 설치
~/Library/Application Support/Code/User/
├── settings.json # mkOutOfStoreSymlink (양방향 수정)
├── keybindings.json # mkOutOfStoreSymlink (양방향 수정)
└── snippets/*.json # HM languageSnippets가 자동 생성
확장 추가/제거 절차
modules/darwin/programs/vscode/default.nix에서 profiles.default.extensions 수정
nrs 실행
- VSCode 재시작
확장 소스 선택: 먼저 open-vsx에서 검색, 없으면 vscode-marketplace 사용.
상세 가이드: references/extensions.md
Nix LSP (nixd)
VSCode에서 .nix 파일 편집 시 nixd LSP가 자동완성/포맷팅을 제공합니다.
nixd와 nixfmt는 VSCode 모듈의 home.packages에 co-locate되어 macOS에서만 설치됩니다.
자주 발생하는 문제
- 확장 로드 오류:
nrs 후 VSCode 재시작 필요
- GUI에서 확장 설치 안 됨:
mutableExtensionsDir = false → Nix 설정에서 추가 후 nrs
- settings.json 충돌:
profiles.default.userSettings 사용 금지 — mkOutOfStoreSymlink과 충돌
기본 앱 연결 (duti)
텍스트/코드 파일 더블클릭 시 VSCode로 열리도록 duti를 사용한다.
home.activation에서 nrs 시 자동 적용. 상세: references/settings.md
레퍼런스