@sebastienrousseau/dotfiles 0.2.481 → 0.2.499

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (317) hide show
  1. package/docs/ARCHITECTURE.md +29 -196
  2. package/docs/COMPLIANCE.md +10 -10
  3. package/docs/COPYRIGHT +3 -4
  4. package/docs/OPERATIONS.md +38 -65
  5. package/docs/PLAN.md +3 -3
  6. package/docs/PR_DESCRIPTION.md +85 -84
  7. package/docs/ROADMAP.md +11 -11
  8. package/docs/ROADMAP_legacy.md +556 -0
  9. package/docs/SECURITY_CHECKLIST.md +1 -1
  10. package/docs/TASK.md +4 -4
  11. package/docs/WALKTHROUGH.md +33 -152
  12. package/package.json +17 -5
  13. package/scripts/backup.sh +142 -0
  14. package/scripts/banner.sh +20 -0
  15. package/scripts/benchmark.sh +20 -0
  16. package/scripts/build.sh +41 -0
  17. package/scripts/clean.sh +31 -0
  18. package/scripts/compile.sh +54 -0
  19. package/scripts/copy.sh +108 -0
  20. package/scripts/{tools/detect-collisions.py → detect-collisions.py} +1 -1
  21. package/scripts/doctor.sh +79 -0
  22. package/scripts/dotfiles.sh +63 -0
  23. package/scripts/download.sh +35 -0
  24. package/scripts/help.sh +57 -0
  25. package/scripts/lock-configs.sh +57 -0
  26. package/scripts/package.sh +46 -0
  27. package/scripts/ssh.sh +55 -0
  28. package/scripts/teleport.sh +23 -0
  29. package/scripts/{tests/test-aliases.sh → test-aliases.sh} +3 -3
  30. package/scripts/test_smoke.sh +88 -0
  31. package/scripts/unpack.sh +28 -0
  32. package/scripts/{diagnostics/verify_state.sh → verify_state.sh} +21 -21
  33. package/templates/projects/go/README.md +0 -4
  34. package/templates/projects/node/README.md +0 -4
  35. package/templates/projects/python/README.md +0 -4
  36. package/templates/projects/python/pyproject.toml +0 -15
  37. package/CHANGELOG.md +0 -285
  38. package/LICENSE +0 -1283
  39. package/README.md +0 -315
  40. package/docs/ALIASES.md +0 -128
  41. package/docs/FEATURES.md +0 -166
  42. package/docs/FONTS.md +0 -147
  43. package/docs/INSTALL.md +0 -119
  44. package/docs/KEYS.md +0 -40
  45. package/docs/KEY_ROTATION.md +0 -219
  46. package/docs/LEGACY_ROADMAP.md +0 -142
  47. package/docs/NEOVIM_IDE_GUIDE.md +0 -52
  48. package/docs/README.md +0 -269
  49. package/docs/REPO_AUDIT.md +0 -23
  50. package/docs/SCREENSHOTS.md +0 -116
  51. package/docs/SECRETS.md +0 -76
  52. package/docs/SECURITY.md +0 -30
  53. package/docs/TESTING.md +0 -190
  54. package/docs/TOOLS.md +0 -146
  55. package/docs/TROUBLESHOOTING.md +0 -112
  56. package/docs/UTILS.md +0 -105
  57. package/docs/WSL2_NIX_TROUBLESHOOTING.md +0 -723
  58. package/docs/adr/ADR-001-ci-cd-pipeline.md +0 -101
  59. package/docs/adr/ADR-002-shell-performance.md +0 -121
  60. package/docs/adr/ADR-003-security-first.md +0 -140
  61. package/docs/adr/ADR-004-cli-architecture.md +0 -157
  62. package/docs/adr/ADR-005-chezmoi-choice.md +0 -89
  63. package/docs/adr/ADR-006-shell-selection.md +0 -115
  64. package/docs/adr/README.md +0 -33
  65. package/docs/themes/README.md +0 -20
  66. package/dot_config/aider/aider.conf.yml +0 -32
  67. package/dot_config/alacritty/alacritty.toml.tmpl +0 -483
  68. package/dot_config/ansible/ansible.cfg.tmpl +0 -11
  69. package/dot_config/atuin/config.toml +0 -23
  70. package/dot_config/bat/config +0 -8
  71. package/dot_config/brave-flags.conf.tmpl +0 -7
  72. package/dot_config/btop/btop.conf +0 -16
  73. package/dot_config/btop/themes/tokyonight.theme +0 -34
  74. package/dot_config/bun/bunfig.toml.tmpl +0 -33
  75. package/dot_config/claude/mcp_servers.json +0 -49
  76. package/dot_config/clippy.toml +0 -55
  77. package/dot_config/containers/containers.conf +0 -14
  78. package/dot_config/curl/dot_curlrc +0 -18
  79. package/dot_config/dlv/config.yml +0 -39
  80. package/dot_config/docker/config.json.tmpl +0 -15
  81. package/dot_config/dotfiles/boot/README.md +0 -11
  82. package/dot_config/dotfiles/grub/README.md +0 -11
  83. package/dot_config/dotfiles/lock/README.md +0 -11
  84. package/dot_config/dotfiles/versions.env.tmpl +0 -19
  85. package/dot_config/duf/duf.conf +0 -6
  86. package/dot_config/duti/defaults.duti +0 -5
  87. package/dot_config/emoji/emoji.txt +0 -34
  88. package/dot_config/fastfetch/config.jsonc +0 -28
  89. package/dot_config/firefox/user.js +0 -8
  90. package/dot_config/flatpak/flatpak.list +0 -4
  91. package/dot_config/fontconfig/fonts.conf.tmpl +0 -44
  92. package/dot_config/gem/gemrc +0 -9
  93. package/dot_config/gh/config.yml +0 -12
  94. package/dot_config/ghostty/config.tmpl +0 -661
  95. package/dot_config/git/attributes +0 -12
  96. package/dot_config/git/config.tmpl +0 -77
  97. package/dot_config/git/ignore +0 -27
  98. package/dot_config/gnupg/gpg-agent.conf.tmpl +0 -11
  99. package/dot_config/go/aliases.sh +0 -61
  100. package/dot_config/go/env.sh +0 -24
  101. package/dot_config/go/golangci.yml +0 -118
  102. package/dot_config/go/gopls.json +0 -30
  103. package/dot_config/goose/config.yaml +0 -29
  104. package/dot_config/gtk-3.0/gtk.css.tmpl +0 -305
  105. package/dot_config/gtk-3.0/settings.ini.tmpl +0 -66
  106. package/dot_config/gtk-4.0/gtk.css.tmpl +0 -309
  107. package/dot_config/gtk-4.0/settings.ini.tmpl +0 -21
  108. package/dot_config/htop/htoprc +0 -20
  109. package/dot_config/ice/README.md +0 -13
  110. package/dot_config/inputrc +0 -2
  111. package/dot_config/ipython/profile_default/ipython_config.py.tmpl +0 -5
  112. package/dot_config/just/justfile +0 -104
  113. package/dot_config/k9s/config.yaml.tmpl +0 -65
  114. package/dot_config/k9s/skins/catppuccin-mocha.yaml +0 -116
  115. package/dot_config/karabiner/karabiner.json +0 -14
  116. package/dot_config/kitty/kitty.conf.tmpl +0 -517
  117. package/dot_config/lazydocker/config.yml +0 -186
  118. package/dot_config/lazygit/config.yml +0 -23
  119. package/dot_config/lsd/config.yaml +0 -19
  120. package/dot_config/mas/masapps.txt +0 -5
  121. package/dot_config/minikube/config.json +0 -13
  122. package/dot_config/mise/config.toml +0 -41
  123. package/dot_config/mongosh/mongoshrc.js +0 -67
  124. package/dot_config/mycli/myclirc +0 -67
  125. package/dot_config/nano/nanorc +0 -28
  126. package/dot_config/ncdu/config +0 -12
  127. package/dot_config/nvim/init.lua +0 -4
  128. package/dot_config/nvim/lazy-lock.json +0 -27
  129. package/dot_config/nvim/lua/config/autocmds.lua +0 -63
  130. package/dot_config/nvim/lua/config/keymaps.lua +0 -87
  131. package/dot_config/nvim/lua/config/lazy.lua +0 -34
  132. package/dot_config/nvim/lua/config/options.lua +0 -48
  133. package/dot_config/nvim/lua/plugins/coding.lua +0 -234
  134. package/dot_config/nvim/lua/plugins/dap.lua +0 -201
  135. package/dot_config/nvim/lua/plugins/editor.lua +0 -59
  136. package/dot_config/nvim/lua/plugins/git.lua +0 -9
  137. package/dot_config/nvim/lua/plugins/lsp.lua +0 -221
  138. package/dot_config/nvim/lua/plugins/markdown.lua +0 -17
  139. package/dot_config/nvim/lua/plugins/rust.lua +0 -33
  140. package/dot_config/nvim/lua/plugins/sessions.lua +0 -32
  141. package/dot_config/nvim/lua/plugins/ui.lua +0 -537
  142. package/dot_config/nvim/snippets/all.lua +0 -9
  143. package/dot_config/nvim/snippets/python.lua +0 -16
  144. package/dot_config/pip/pip.conf.tmpl +0 -32
  145. package/dot_config/pypoetry/config.toml.tmpl +0 -6
  146. package/dot_config/pyrightconfig.json.tmpl +0 -5
  147. package/dot_config/raycast/README.md +0 -13
  148. package/dot_config/redis/redisclirc +0 -41
  149. package/dot_config/shell/00-container-detect.sh +0 -53
  150. package/dot_config/shell/00-core-paths.sh.tmpl +0 -95
  151. package/dot_config/shell/05-core-safety.sh.tmpl +0 -13
  152. package/dot_config/shell/40-ls-colors.sh.tmpl +0 -31
  153. package/dot_config/shell/50-logic-functions.sh.tmpl +0 -10
  154. package/dot_config/shell/90-theme-switch.sh +0 -70
  155. package/dot_config/shell/90-ux-aliases.sh.tmpl +0 -35
  156. package/dot_config/shell/91-ux-aliases-lazy.sh.tmpl +0 -23
  157. package/dot_config/shell/Brewfile +0 -207
  158. package/dot_config/shell/Brewfile.cask +0 -92
  159. package/dot_config/shell/Brewfile.cli +0 -119
  160. package/dot_config/shell/README.md +0 -267
  161. package/dot_config/shell/custom/context_suggest.zsh +0 -68
  162. package/dot_config/shell/custom/error_analysis.zsh +0 -45
  163. package/dot_config/sops/dot_sops.yaml +0 -23
  164. package/dot_config/starship.toml.tmpl +0 -124
  165. package/dot_config/task/Taskfile.yml +0 -86
  166. package/dot_config/tflint/tflint.hcl.tmpl +0 -9
  167. package/dot_config/tmux/tmux.conf.tmpl +0 -181
  168. package/dot_config/topgrade/topgrade.toml.tmpl +0 -42
  169. package/dot_config/vscode/extensions.txt +0 -11
  170. package/dot_config/vscode/settings.json.tmpl +0 -123
  171. package/dot_config/waybar/style.css +0 -8
  172. package/dot_config/wezterm/wezterm.lua.tmpl +0 -236
  173. package/dot_config/wget/wgetrc +0 -12
  174. package/dot_config/yarn/yarnrc.yml.tmpl +0 -36
  175. package/dot_config/yazi/yazi.toml +0 -40
  176. package/dot_config/zellij/config.kdl +0 -79
  177. package/dot_config/zsh/dot_zprofile +0 -13
  178. package/dot_config/zsh/dot_zshenv +0 -6
  179. package/dot_config/zsh/dot_zshrc.tmpl +0 -199
  180. package/dot_config/zsh/rc.d/05-ssh-agent.zsh +0 -5
  181. package/dot_config/zsh/rc.d/10-env.zsh.tmpl +0 -28
  182. package/dot_config/zsh/rc.d/20-zinit.zsh.tmpl +0 -22
  183. package/dot_config/zsh/rc.d/30-options.zsh.tmpl +0 -123
  184. package/dot_config/zsh/rc.d/40-bell.zsh.tmpl +0 -20
  185. package/dot_config/zsh/rc.d/50-login-fortune.zsh.tmpl +0 -9
  186. package/dot_local/bin/executable_ai_core +0 -130
  187. package/dot_local/bin/executable_b64 +0 -59
  188. package/dot_local/bin/executable_dot +0 -178
  189. package/dot_local/bin/executable_dot_completion +0 -55
  190. package/dot_local/bin/executable_epoch +0 -62
  191. package/dot_local/bin/executable_extract +0 -108
  192. package/dot_local/bin/executable_git-ai-commit +0 -160
  193. package/dot_local/bin/executable_git-ai-diff +0 -154
  194. package/dot_local/bin/executable_hash +0 -123
  195. package/dot_local/bin/executable_hex +0 -79
  196. package/dot_local/bin/executable_ip +0 -37
  197. package/dot_local/bin/executable_jsonv +0 -54
  198. package/dot_local/bin/executable_jwt +0 -78
  199. package/dot_local/bin/executable_kill-port +0 -59
  200. package/dot_local/bin/executable_lorem +0 -103
  201. package/dot_local/bin/executable_regex +0 -96
  202. package/dot_local/bin/executable_tmux-sessionizer +0 -187
  203. package/dot_local/bin/executable_tour +0 -137
  204. package/dot_local/bin/executable_update +0 -108
  205. package/dot_local/bin/executable_uuid +0 -57
  206. package/dot_local/bin/executable_yamlv +0 -39
  207. package/dot_local/bin/executable_zig-install +0 -89
  208. package/dot_local/bin/voice_ops +0 -7
  209. package/dot_local/share/bash-completion/completions/dot +0 -54
  210. package/dot_local/share/zsh/completions/.keep +0 -0
  211. package/install.sh +0 -255
  212. package/scripts/ci/validate-ci-config.sh +0 -222
  213. package/scripts/demo/record.sh +0 -41
  214. package/scripts/diagnostics/benchmark.sh +0 -201
  215. package/scripts/diagnostics/doctor.sh +0 -115
  216. package/scripts/diagnostics/drift-dashboard.sh +0 -26
  217. package/scripts/diagnostics/health.sh +0 -356
  218. package/scripts/diagnostics/history-analysis.sh +0 -77
  219. package/scripts/diagnostics/security-score.sh +0 -392
  220. package/scripts/dot/commands/appearance.sh +0 -63
  221. package/scripts/dot/commands/core.sh +0 -130
  222. package/scripts/dot/commands/diagnostics.sh +0 -100
  223. package/scripts/dot/commands/meta.sh +0 -117
  224. package/scripts/dot/commands/restore.sh +0 -209
  225. package/scripts/dot/commands/secrets.sh +0 -81
  226. package/scripts/dot/commands/security.sh +0 -73
  227. package/scripts/dot/commands/tools.sh +0 -228
  228. package/scripts/dot/lib/utils.sh +0 -72
  229. package/scripts/fonts/install-nerd-fonts.sh +0 -59
  230. package/scripts/fonts/patch-fonts.sh +0 -34
  231. package/scripts/ops/chezmoi-apply.sh +0 -42
  232. package/scripts/ops/chezmoi-diff.sh +0 -14
  233. package/scripts/ops/chezmoi-remove.sh +0 -43
  234. package/scripts/ops/chezmoi-update.sh +0 -16
  235. package/scripts/ops/heal.sh +0 -466
  236. package/scripts/ops/health-check.sh +0 -380
  237. package/scripts/ops/rollback.sh +0 -531
  238. package/scripts/ops/teleport.sh +0 -32
  239. package/scripts/secrets/age-init.sh +0 -69
  240. package/scripts/secrets/create-secrets-file.sh +0 -44
  241. package/scripts/secrets/encrypt-ssh-key.sh +0 -42
  242. package/scripts/security/backup.sh +0 -17
  243. package/scripts/security/dns-doh.sh +0 -29
  244. package/scripts/security/encryption-check.sh +0 -39
  245. package/scripts/security/enforce-policies.sh +0 -339
  246. package/scripts/security/firewall.sh +0 -34
  247. package/scripts/security/lock-configs.sh +0 -57
  248. package/scripts/security/lock-screen.sh +0 -33
  249. package/scripts/security/manage-secrets.sh +0 -415
  250. package/scripts/security/telemetry-kill.sh +0 -28
  251. package/scripts/security/usb-safety.sh +0 -29
  252. package/scripts/tests/README.md +0 -241
  253. package/scripts/tests/benchmark.sh +0 -91
  254. package/scripts/tests/framework/assertions.sh +0 -283
  255. package/scripts/tests/framework/mocks.sh +0 -201
  256. package/scripts/tests/framework/test_runner.sh +0 -189
  257. package/scripts/tests/integration/test_install.sh +0 -237
  258. package/scripts/tests/performance/benchmark_runner.sh +0 -156
  259. package/scripts/tests/performance/regression_check.sh +0 -73
  260. package/scripts/tests/performance/stress_test.sh +0 -65
  261. package/scripts/tests/test-docker.sh +0 -48
  262. package/scripts/tests/unit/test_ai_aliases.sh +0 -158
  263. package/scripts/tests/unit/test_ai_cli_checks.sh +0 -47
  264. package/scripts/tests/unit/test_backup.sh +0 -227
  265. package/scripts/tests/unit/test_case_functions.sh +0 -238
  266. package/scripts/tests/unit/test_cd_aliases.sh +0 -367
  267. package/scripts/tests/unit/test_dot_cli.sh +0 -217
  268. package/scripts/tests/unit/test_encode64.sh +0 -67
  269. package/scripts/tests/unit/test_environment.sh +0 -78
  270. package/scripts/tests/unit/test_extract.sh +0 -163
  271. package/scripts/tests/unit/test_framework_edge_cases.sh +0 -113
  272. package/scripts/tests/unit/test_genpass.sh +0 -298
  273. package/scripts/tests/unit/test_install_edge_cases.sh +0 -167
  274. package/scripts/tests/unit/test_installers.sh +0 -172
  275. package/scripts/tests/unit/test_keygen.sh +0 -68
  276. package/scripts/tests/unit/test_logging.sh +0 -96
  277. package/scripts/tests/unit/test_os_detection_comprehensive.sh +0 -388
  278. package/scripts/tests/unit/test_package_managers_comprehensive.sh +0 -321
  279. package/scripts/tests/unit/test_prependpath.sh +0 -66
  280. package/scripts/tests/unit/test_prependpath_refactored.sh +0 -89
  281. package/scripts/tests/unit/test_rd.sh +0 -230
  282. package/scripts/tests/unit/test_security_fixes.sh +0 -130
  283. package/scripts/tests/unit/test_security_scripts.sh +0 -87
  284. package/scripts/tests/unit/test_template_validation.sh +0 -238
  285. package/scripts/tests/unit/test_utility_functions.sh +0 -144
  286. package/scripts/tests/unit/test_wave1_alias_split.sh +0 -132
  287. package/scripts/tests/unit/test_wave1_ci_pinning.sh +0 -61
  288. package/scripts/tests/unit/test_wave1_gitleaks_config.sh +0 -52
  289. package/scripts/tests/unit/test_wave1_heal_fixes.sh +0 -97
  290. package/scripts/tests/unit/test_wave1_install_gpg.sh +0 -35
  291. package/scripts/tests/unit/test_wave1_zshenv_path.sh +0 -89
  292. package/scripts/tests/unit/test_wave1_zshrc_lazy_hook.sh +0 -115
  293. package/scripts/tests/unit/test_wave2_dot_new_guard.sh +0 -75
  294. package/scripts/tests/unit/test_zipf.sh +0 -76
  295. package/scripts/theme/apply-gnome-theme.sh +0 -297
  296. package/scripts/theme/install-boot-logo.sh +0 -61
  297. package/scripts/theme/install-catppuccin-themes.sh +0 -346
  298. package/scripts/theme/install-cursors.sh +0 -24
  299. package/scripts/theme/install-file-icons.sh +0 -25
  300. package/scripts/theme/install-grub-theme.sh +0 -51
  301. package/scripts/theme/install-lock-icon.sh +0 -29
  302. package/scripts/theme/switch.sh +0 -250
  303. package/scripts/theme/wallpaper-rotate.sh +0 -82
  304. package/scripts/theme/wallpaper-sync.sh +0 -42
  305. package/scripts/tools/cmatrix.sh +0 -20
  306. package/scripts/tools/emoji-picker.sh +0 -45
  307. package/scripts/tools/figlet-banner.sh +0 -17
  308. package/scripts/tools/log-rotate.sh +0 -29
  309. package/scripts/tools/lolcat-wrap.sh +0 -18
  310. package/scripts/tools/pipes.sh +0 -47
  311. package/scripts/tuning/linux.sh +0 -175
  312. package/scripts/tuning/macos.sh +0 -46
  313. package/templates/projects/molecule/README.md +0 -7
  314. package/templates/projects/molecule/converge.yml +0 -7
  315. package/templates/projects/molecule/molecule.yml +0 -16
  316. package/templates/projects/packer/README.md +0 -15
  317. package/templates/projects/packer/main.pkr.hcl +0 -15
@@ -1,723 +0,0 @@
1
- # WSL2 & Nix Integration Troubleshooting Guide
2
-
3
- ### Metadata
4
- - **Type:** How-To Guide / Reference
5
- - **Audience:** Intermediate / Advanced
6
- - **Prerequisites:** Basic familiarity with command line, WSL2, and Nix package manager
7
-
8
- ### Content
9
-
10
- A comprehensive troubleshooting guide for WSL2 edge cases, Nix integration issues, and recovery procedures for failed installations.
11
-
12
- ## Table of Contents
13
-
14
- - [WSL2 Edge Cases](#wsl2-edge-cases)
15
- - [Nix Integration Issues](#nix-integration-issues)
16
- - [Recovery Procedures](#recovery-procedures)
17
- - [Performance Optimization](#performance-optimization)
18
- - [Cross-Platform Migration](#cross-platform-migration)
19
- - [Emergency Recovery](#emergency-recovery)
20
-
21
- ---
22
-
23
- ## WSL2 Edge Cases
24
-
25
- ### Filesystem Issues
26
-
27
- #### Problem: Symlinks fail to work between Windows and WSL2
28
- ```bash
29
- # Check if symlinks are enabled
30
- ls -la ~/.dotfiles/
31
- # Look for broken symlinks (red entries)
32
- ```
33
-
34
- **Root Cause:** Windows filesystem doesn't support Unix symlinks by default.
35
-
36
- **Solutions:**
37
- 1. **Enable Developer Mode** (Windows 10/11):
38
- ```powershell
39
- # Run in PowerShell as Administrator
40
- dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
41
- ```
42
-
43
- 2. **Use WSL2 native filesystem**:
44
- ```bash
45
- # Move dotfiles to WSL2 filesystem
46
- cd /home/$USER
47
- git clone https://github.com/yourusername/dotfiles.git .dotfiles
48
- ```
49
-
50
- 3. **Configure Git for WSL2**:
51
- ```bash
52
- git config --global core.symlinks true
53
- git config --global core.autocrlf false
54
- ```
55
-
56
- #### Problem: Slow filesystem performance on Windows drives
57
- ```bash
58
- # Test filesystem performance
59
- time ls -la /mnt/c/Users/
60
- time ls -la ~/
61
- ```
62
-
63
- **Solution:** Always work within WSL2 filesystem (`/home/`) for performance-critical operations.
64
-
65
- #### Problem: Permission denied errors on mounted Windows drives
66
- ```bash
67
- # Check mount options
68
- mount | grep drvfs
69
- ```
70
-
71
- **Solution:** Remount with proper permissions:
72
- ```bash
73
- # Create /etc/wsl.conf
74
- sudo tee /etc/wsl.conf > /dev/null <<EOF
75
- [automount]
76
- enabled = true
77
- root = /mnt/
78
- options = "metadata,umask=22,fmask=11"
79
- mountFsTab = false
80
- EOF
81
-
82
- # Restart WSL2 from Windows PowerShell
83
- wsl --shutdown
84
- ```
85
-
86
- ### Networking Issues
87
-
88
- #### Problem: DNS resolution fails in WSL2
89
- ```bash
90
- # Test DNS resolution
91
- nslookup github.com
92
- ping github.com
93
- ```
94
-
95
- **Solutions:**
96
- 1. **Reset WSL2 DNS**:
97
- ```bash
98
- sudo rm /etc/resolv.conf
99
- sudo bash -c 'echo "nameserver 8.8.8.8" > /etc/resolv.conf'
100
- ```
101
-
102
- 2. **Configure permanent DNS**:
103
- ```bash
104
- sudo tee /etc/wsl.conf > /dev/null <<EOF
105
- [network]
106
- generateResolvConf = false
107
- EOF
108
-
109
- sudo tee /etc/resolv.conf > /dev/null <<EOF
110
- nameserver 1.1.1.1
111
- nameserver 8.8.8.8
112
- EOF
113
- ```
114
-
115
- #### Problem: Port forwarding doesn't work
116
- ```bash
117
- # Check if port is bound
118
- netstat -tulpn | grep :3000
119
- ```
120
-
121
- **Solution:** Use Windows port proxy:
122
- ```powershell
123
- # Run in PowerShell as Administrator
124
- netsh interface portproxy add v4tov4 listenport=3000 listenaddress=0.0.0.0 connectport=3000 connectaddress=172.x.x.x
125
- ```
126
-
127
- ### Memory and Resource Issues
128
-
129
- #### Problem: WSL2 consumes excessive memory
130
- ```bash
131
- # Check WSL2 memory usage
132
- cat /proc/meminfo | grep MemTotal
133
- free -h
134
- ```
135
-
136
- **Solution:** Limit WSL2 memory usage:
137
- ```ini
138
- # Create %UserProfile%\.wslconfig
139
- [wsl2]
140
- memory=8GB
141
- processors=4
142
- swap=2GB
143
- ```
144
-
145
- #### Problem: WSL2 doesn't release memory back to Windows
146
- **Solution:** Compact WSL2 virtual disk:
147
- ```powershell
148
- # Run in PowerShell as Administrator
149
- wsl --shutdown
150
- diskpart
151
- # select vdisk file="C:\Users\%USERNAME%\AppData\Local\Packages\CanonicalGroupLimited.UbuntuonWindows_79rhkp1fndgsc\LocalState\ext4.vhdx"
152
- # attach vdisk readonly
153
- # compact vdisk
154
- # detach vdisk
155
- # exit
156
- ```
157
-
158
- ---
159
-
160
- ## Nix Integration Issues
161
-
162
- ### Installation Problems
163
-
164
- #### Problem: Nix installation fails on WSL2
165
- ```bash
166
- # Check if installation attempted
167
- ls -la /nix/
168
- which nix
169
- ```
170
-
171
- **Solutions:**
172
- 1. **Use deterministic installer**:
173
- ```bash
174
- curl -L https://nixos.org/nix/install | sh -s -- --daemon
175
- ```
176
-
177
- 2. **Fix permissions after installation**:
178
- ```bash
179
- sudo chown -R $(whoami) /nix/var/nix/profiles/per-user/$(whoami)/
180
- sudo chmod -R 755 /nix/var/nix/profiles/per-user/$(whoami)/
181
- ```
182
-
183
- 3. **Enable systemd for Nix daemon** (WSL2 Ubuntu 22.04+):
184
- ```bash
185
- sudo tee /etc/wsl.conf > /dev/null <<EOF
186
- [boot]
187
- systemd=true
188
- EOF
189
- ```
190
-
191
- #### Problem: Nix flakes not recognized
192
- ```bash
193
- # Test flakes support
194
- nix flake --help
195
- ```
196
-
197
- **Solution:** Enable experimental features:
198
- ```bash
199
- mkdir -p ~/.config/nix/
200
- tee ~/.config/nix/nix.conf > /dev/null <<EOF
201
- experimental-features = nix-command flakes
202
- trusted-users = $(whoami)
203
- EOF
204
-
205
- # Or globally
206
- sudo tee /etc/nix/nix.conf > /dev/null <<EOF
207
- experimental-features = nix-command flakes
208
- trusted-users = @wheel
209
- EOF
210
- ```
211
-
212
- #### Problem: SSL certificate errors during Nix operations
213
- ```bash
214
- # Test Nix store access
215
- nix ping-store
216
- ```
217
-
218
- **Solutions:**
219
- 1. **Update CA certificates**:
220
- ```bash
221
- sudo apt update && sudo apt install ca-certificates
222
- ```
223
-
224
- 2. **Configure Nix with custom CA bundle**:
225
- ```bash
226
- export NIX_SSL_CERT_FILE=/etc/ssl/certs/ca-certificates.crt
227
- echo 'export NIX_SSL_CERT_FILE=/etc/ssl/certs/ca-certificates.crt' >> ~/.bashrc
228
- ```
229
-
230
- ### Flake and Profile Issues
231
-
232
- #### Problem: Flake lock file conflicts
233
- ```bash
234
- # Check flake lock status
235
- cd ~/.dotfiles/nix/
236
- nix flake check --impure
237
- ```
238
-
239
- **Solution:** Update and rebuild lock file:
240
- ```bash
241
- cd ~/.dotfiles/nix/
242
- rm flake.lock
243
- nix flake update
244
- nix flake check
245
- ```
246
-
247
- #### Problem: Nix profile conflicts with system packages
248
- ```bash
249
- # List Nix profiles
250
- nix profile list
251
- # Check which packages are shadowing system ones
252
- which -a git
253
- ```
254
-
255
- **Solutions:**
256
- 1. **Remove conflicting profiles**:
257
- ```bash
258
- nix profile remove <profile-number>
259
- ```
260
-
261
- 2. **Use priority settings**:
262
- ```bash
263
- nix profile install nixpkgs#git --priority 10
264
- ```
265
-
266
- 3. **Create isolated development environments**:
267
- ```bash
268
- cd ~/.dotfiles/nix/
269
- nix develop
270
- ```
271
-
272
- #### Problem: Nix store corruption
273
- ```bash
274
- # Check store integrity
275
- nix-store --verify --check-contents
276
- ```
277
-
278
- **Solution:** Repair corrupted store:
279
- ```bash
280
- # Stop Nix daemon
281
- sudo systemctl stop nix-daemon
282
-
283
- # Repair store
284
- sudo nix-store --verify --check-contents --repair
285
-
286
- # Restart daemon
287
- sudo systemctl start nix-daemon
288
- ```
289
-
290
- ### Build and Cache Issues
291
-
292
- #### Problem: Binary cache not working
293
- ```bash
294
- # Test cache connectivity
295
- nix ping-store --store https://cache.nixos.org
296
- ```
297
-
298
- **Solution:** Configure trusted substituters:
299
- ```bash
300
- sudo tee -a /etc/nix/nix.conf > /dev/null <<EOF
301
- substituters = https://cache.nixos.org/ https://nix-community.cachix.org
302
- trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=
303
- EOF
304
- ```
305
-
306
- #### Problem: Out of disk space during build
307
- ```bash
308
- # Check Nix store size
309
- du -sh /nix/store/
310
- df -h /nix/
311
- ```
312
-
313
- **Solution:** Clean up Nix store:
314
- ```bash
315
- # Remove unused packages
316
- nix-collect-garbage
317
-
318
- # Deep cleanup (removes old generations)
319
- nix-collect-garbage -d
320
-
321
- # Optimize store (hard link identical files)
322
- nix-store --optimise
323
- ```
324
-
325
- ---
326
-
327
- ## Recovery Procedures
328
-
329
- ### Complete System Recovery
330
-
331
- #### Scenario: Dotfiles installation completely broken
332
- ```bash
333
- # 1. Backup current state
334
- cp ~/.zshrc ~/.zshrc.backup.$(date +%s)
335
- cp ~/.bashrc ~/.bashrc.backup.$(date +%s)
336
-
337
- # 2. Reset to minimal shell
338
- export PATH=/usr/bin:/bin
339
- unset ZDOTDIR
340
-
341
- # 3. Clean chezmoi state
342
- rm -rf ~/.local/share/chezmoi/
343
- rm -rf ~/.config/chezmoi/
344
-
345
- # 4. Reinstall from scratch
346
- cd /tmp
347
- curl -fsSL https://raw.githubusercontent.com/yourusername/dotfiles/main/install.sh | bash
348
- ```
349
-
350
- #### Scenario: WSL2 completely broken
351
- ```powershell
352
- # From Windows PowerShell as Administrator
353
-
354
- # 1. Export current installation (backup)
355
- wsl --export Ubuntu Ubuntu-backup.tar
356
-
357
- # 2. Unregister broken installation
358
- wsl --unregister Ubuntu
359
-
360
- # 3. Reinstall from Microsoft Store or import backup
361
- wsl --import Ubuntu C:\WSL\Ubuntu Ubuntu-backup.tar
362
-
363
- # 4. Reinstall dotfiles
364
- wsl -d Ubuntu -u root -- curl -fsSL https://raw.githubusercontent.com/yourusername/dotfiles/main/install.sh | bash
365
- ```
366
-
367
- ### Partial Recovery
368
-
369
- #### Fix broken Nix installation
370
- ```bash
371
- # 1. Remove broken Nix
372
- sudo rm -rf /nix/
373
- sudo userdel -r nix-daemon 2>/dev/null || true
374
- sudo groupdel nixbld 2>/dev/null || true
375
-
376
- # 2. Clean environment
377
- unset NIX_PATH
378
- unset NIX_PROFILES
379
- unset NIX_SSL_CERT_FILE
380
-
381
- # 3. Reinstall Nix
382
- curl -L https://nixos.org/nix/install | sh
383
-
384
- # 4. Restart shell and test
385
- exec zsh
386
- which nix
387
- ```
388
-
389
- #### Fix broken shell configuration
390
- ```bash
391
- # 1. Use emergency shell config
392
- cat > ~/.zshrc.emergency <<'EOF'
393
- export PATH=/usr/bin:/bin:/usr/sbin:/sbin
394
- export SHELL=/bin/zsh
395
- alias ll='ls -la'
396
- alias la='ls -la'
397
- PS1='%n@%m:%~$ '
398
- EOF
399
-
400
- # 2. Test emergency config
401
- zsh -c 'source ~/.zshrc.emergency && echo "Emergency config works"'
402
-
403
- # 3. Gradually restore
404
- mv ~/.zshrc ~/.zshrc.broken
405
- ln -s ~/.zshrc.emergency ~/.zshrc
406
-
407
- # 4. Reinstall dotfiles piece by piece
408
- cd ~/.dotfiles
409
- chezmoi init --force
410
- chezmoi apply --dry-run
411
- chezmoi apply
412
- ```
413
-
414
- ### Data Recovery
415
-
416
- #### Recover encrypted secrets
417
- ```bash
418
- # 1. Check if key file exists
419
- ls -la ~/.config/chezmoi/key.txt
420
-
421
- # 2. If missing, try to recover from backup locations
422
- find / -name "key.txt" -type f 2>/dev/null
423
- find /mnt/c/ -name "*.key" -type f 2>/dev/null
424
-
425
- # 3. Test key validity
426
- age -d -i ~/.config/chezmoi/key.txt ~/.local/share/chezmoi/encrypted_file.age
427
-
428
- # 4. If key is lost, regenerate encrypted files
429
- chezmoi execute-template --init --force
430
- ```
431
-
432
- #### Recover Git configuration
433
- ```bash
434
- # 1. Check current git config
435
- git config --list --show-origin
436
-
437
- # 2. Backup current config
438
- cp ~/.gitconfig ~/.gitconfig.backup.$(date +%s)
439
-
440
- # 3. Restore from dotfiles
441
- chezmoi apply --include='**/dot_gitconfig*'
442
-
443
- # 4. Verify critical settings
444
- git config --get user.name
445
- git config --get user.email
446
- git config --get core.editor
447
- ```
448
-
449
- ---
450
-
451
- ## Performance Optimization
452
-
453
- ### WSL2 Performance Tuning
454
-
455
- #### Optimize filesystem performance
456
- ```bash
457
- # 1. Move frequently accessed files to WSL2 filesystem
458
- mkdir -p /home/$USER/workspace
459
- ln -s /home/$USER/workspace ~/workspace
460
-
461
- # 2. Configure Git for performance
462
- git config --global core.preloadindex true
463
- git config --global core.fscache true
464
- git config --global gc.auto 256
465
-
466
- # 3. Use native WSL2 paths in tools
467
- export BROWSER="/mnt/c/Program Files/Mozilla Firefox/firefox.exe"
468
- export EDITOR="nvim"
469
- ```
470
-
471
- #### Reduce memory usage
472
- ```bash
473
- # 1. Limit shell history
474
- echo 'HISTSIZE=1000' >> ~/.zshrc
475
- echo 'SAVEHIST=1000' >> ~/.zshrc
476
-
477
- # 2. Disable unnecessary services
478
- sudo systemctl disable apache2 2>/dev/null || true
479
- sudo systemctl disable mysql 2>/dev/null || true
480
-
481
- # 3. Configure swap usage
482
- echo 'vm.swappiness=10' | sudo tee -a /etc/sysctl.conf
483
- ```
484
-
485
- ### Nix Performance Tuning
486
-
487
- #### Optimize Nix builds
488
- ```bash
489
- # Configure build settings
490
- sudo tee -a /etc/nix/nix.conf > /dev/null <<EOF
491
- max-jobs = auto
492
- cores = 0
493
- sandbox = true
494
- substituters = https://cache.nixos.org/ https://nix-community.cachix.org
495
- trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=
496
- EOF
497
- ```
498
-
499
- #### Enable build caching
500
- ```bash
501
- # Install and configure cachix
502
- nix profile install nixpkgs#cachix
503
- cachix use nix-community
504
-
505
- # Add to shell config
506
- echo 'eval "$(cachix completion bash)"' >> ~/.bashrc
507
- ```
508
-
509
- ---
510
-
511
- ## Cross-Platform Migration
512
-
513
- ### Moving from macOS to WSL2
514
-
515
- #### Environment differences checklist
516
- ```bash
517
- # 1. Check path differences
518
- echo $PATH | tr ':' '\n' | sort
519
-
520
- # 2. Check shell differences
521
- echo $SHELL
522
- zsh --version
523
-
524
- # 3. Check package managers
525
- which brew 2>/dev/null && echo "Homebrew found"
526
- which apt 2>/dev/null && echo "APT found"
527
- which nix 2>/dev/null && echo "Nix found"
528
- ```
529
-
530
- #### Migration procedure
531
- ```bash
532
- # 1. Export current configuration
533
- cd ~/.dotfiles
534
- chezmoi archive --format=tar | gzip > dotfiles-backup.tar.gz
535
-
536
- # 2. Transfer to WSL2 (from Windows side)
537
- # Copy dotfiles-backup.tar.gz to Windows, then:
538
- # cp /mnt/c/Users/username/Downloads/dotfiles-backup.tar.gz ./
539
-
540
- # 3. Import on WSL2
541
- tar -xzf dotfiles-backup.tar.gz
542
- cd ~/.dotfiles
543
- git remote update
544
- git pull origin main
545
-
546
- # 4. Platform-specific adjustments
547
- chezmoi apply --dry-run
548
- chezmoi apply
549
- ```
550
-
551
- ### Moving from Linux to WSL2
552
-
553
- #### Handle systemd differences
554
- ```bash
555
- # Check systemd status
556
- systemctl is-system-running 2>/dev/null || echo "systemd not available"
557
-
558
- # Alternative service management for WSL2
559
- sudo service ssh start # Instead of systemctl start ssh
560
- ```
561
-
562
- #### Network configuration migration
563
- ```bash
564
- # 1. Export network settings from source system
565
- ip route show > network-config.txt
566
- cat /etc/resolv.conf >> network-config.txt
567
-
568
- # 2. Adapt for WSL2
569
- # (WSL2 handles most networking automatically)
570
- ```
571
-
572
- ---
573
-
574
- ## Emergency Recovery
575
-
576
- ### Emergency Shell Access
577
-
578
- #### If shell is completely broken
579
- ```bash
580
- # 1. Access via different shell
581
- /bin/bash --noprofile --norc
582
-
583
- # 2. Or use emergency profile
584
- export PATH=/usr/bin:/bin
585
- export PS1="EMERGENCY $ "
586
- export SHELL=/bin/bash
587
-
588
- # 3. Fix basic functionality
589
- alias ls='ls --color=auto'
590
- alias ll='ls -la'
591
- ```
592
-
593
- #### If WSL2 won't start
594
- ```powershell
595
- # From Windows PowerShell as Administrator
596
-
597
- # 1. Check WSL2 status
598
- wsl --status
599
-
600
- # 2. Restart WSL2 service
601
- net stop LxssManager
602
- net start LxssManager
603
-
604
- # 3. If that fails, restart Docker Desktop (if installed)
605
- # Then restart WSL2
606
-
607
- # 4. Last resort: restart Windows
608
- ```
609
-
610
- ### Emergency Contacts and Resources
611
-
612
- #### Diagnostic commands for support requests
613
- ```bash
614
- # System information
615
- cat /etc/os-release
616
- uname -a
617
- wsl.exe --version 2>/dev/null || echo "Not in WSL2"
618
-
619
- # Nix information
620
- nix --version 2>/dev/null || echo "Nix not installed"
621
- nix-env --version 2>/dev/null || echo "nix-env not available"
622
-
623
- # Dotfiles information
624
- cd ~/.dotfiles && git log --oneline -5
625
- chezmoi --version 2>/dev/null || echo "Chezmoi not installed"
626
-
627
- # Generate diagnostic report
628
- cat > ~/diagnostic-report.txt <<EOF
629
- Date: $(date)
630
- User: $(whoami)
631
- Shell: $SHELL
632
- OS: $(cat /etc/os-release | grep PRETTY_NAME)
633
- Kernel: $(uname -r)
634
- WSL Version: $(wsl.exe --version 2>/dev/null || echo "Not in WSL2")
635
- Nix Version: $(nix --version 2>/dev/null || echo "Not installed")
636
- Chezmoi Version: $(chezmoi --version 2>/dev/null || echo "Not installed")
637
-
638
- Recent Git Commits:
639
- $(cd ~/.dotfiles && git log --oneline -5 2>/dev/null || echo "Git not available")
640
-
641
- Current PATH:
642
- $(echo $PATH | tr ':' '\n' | nl)
643
-
644
- Nix Profiles:
645
- $(nix profile list 2>/dev/null || echo "Nix profiles not available")
646
-
647
- WSL Mount Points:
648
- $(mount | grep drvfs || echo "No Windows mounts")
649
- EOF
650
-
651
- echo "Diagnostic report saved to ~/diagnostic-report.txt"
652
- ```
653
-
654
- #### Support channels
655
- - GitHub Issues: [Repository Issues](https://github.com/yourusername/dotfiles/issues)
656
- - WSL2 Documentation: [Microsoft WSL Docs](https://docs.microsoft.com/en-us/windows/wsl/)
657
- - Nix Documentation: [Nix Manual](https://nixos.org/manual/nix/stable/)
658
- - Community Support: Stack Overflow, NixOS Discourse
659
-
660
- ---
661
-
662
- ## Quick Reference
663
-
664
- ### Essential Commands
665
- ```bash
666
- # System status
667
- dot doctor # Run dotfiles health check
668
- wsl --status # WSL2 status
669
- nix profile list # List Nix packages
670
- chezmoi status # Chezmoi status
671
-
672
- # Quick fixes
673
- chezmoi apply # Reapply dotfiles
674
- source ~/.zshrc # Reload shell config
675
- nix-collect-garbage # Clean Nix store
676
- sudo systemctl restart nix-daemon # Restart Nix daemon
677
-
678
- # Emergency access
679
- /bin/bash --noprofile # Clean shell
680
- export PATH=/usr/bin:/bin # Minimal PATH
681
- ```
682
-
683
- ### Recovery Commands
684
- ```bash
685
- # Nuclear options (use with caution)
686
- rm -rf ~/.local/share/chezmoi/ # Reset chezmoi
687
- sudo rm -rf /nix/ # Remove Nix completely
688
- wsl --unregister Ubuntu # Reset WSL2 (from PowerShell)
689
- ```
690
-
691
- This guide covers the most common WSL2 and Nix edge cases. For issues not covered here, refer to the specific tool documentation or create a support request with the diagnostic information provided.
692
-
693
- ### Validation Checklist
694
-
695
- Before reporting issues, verify your environment with these commands:
696
-
697
- ```bash
698
- # WSL2 Environment Check
699
- echo "=== WSL2 Environment Check ==="
700
- uname -a
701
- cat /proc/version | grep -i wsl || echo "Not running in WSL2"
702
- mount | grep drvfs | head -3
703
- df -h / /tmp
704
-
705
- # Nix Installation Check
706
- echo "=== Nix Installation Check ==="
707
- command -v nix && nix --version || echo "Nix not installed"
708
- echo $NIX_PATH
709
- ls -la ~/.config/nix/ 2>/dev/null || echo "No Nix config directory"
710
-
711
- # Dotfiles Status Check
712
- echo "=== Dotfiles Status Check ==="
713
- command -v chezmoi && chezmoi --version || echo "Chezmoi not installed"
714
- cd ~/.dotfiles && git status --porcelain || echo "Not in dotfiles directory"
715
- ls -la ~/.dotfiles/nix/flake.nix 2>/dev/null || echo "Nix flake not found"
716
-
717
- # Performance Check
718
- echo "=== Performance Check ==="
719
- time ls ~/.dotfiles >/dev/null
720
- free -m 2>/dev/null || vm_stat | head -5
721
- ```
722
-
723
- Run this checklist and include the output when requesting support.