My nix-darwin and NixOS config
3
fork

Configure Feed

Select the types of activity you want to include in your feed.

fix(vscode): update settings path handling and improve symlink configuration

+14 -3
+14 -3
home/programs/vscode.nix
··· 2 2 { 3 3 pkgs, 4 4 lib, 5 + config, 5 6 osConfig, 6 7 ... 7 8 }: 8 9 let 9 10 cfg = osConfig.myConfig; 10 11 d = cfg.desktop; 12 + isDarwin = pkgs.stdenv.isDarwin; 11 13 12 14 # Font strings derived from desktop options — single source of truth. 13 15 editorFont = d.monoFontBase; # "FiraCode" ··· 55 57 "svelte.svelte-vscode" 56 58 "ms-vscode.makefile-tools" 57 59 ]; 60 + 61 + # Settings path differs by platform: 62 + # macOS: ~/Library/Application Support/Code/User/settings.json 63 + # NixOS: ~/.config/Code/User/settings.json 64 + settingsPath = 65 + if isDarwin then 66 + "Library/Application Support/Code/User/settings.json" 67 + else 68 + ".config/Code/User/settings.json"; 58 69 in 59 70 { 60 71 programs.vscode = { ··· 67 78 }; 68 79 }; 69 80 70 - # Writable VS Code settings — symlinked directly from nix-config repo. 81 + # Writable VS Code settings — symlinked from nix-config repo. 71 82 # Edit at ~/.config/nix-config/home/programs/vscode/settings.json 72 - home.file."Library/Application Support/Code/User/settings.json".source = 73 - lib.file.mkOutOfStoreSymlink "${builtins.getEnv "HOME"}/.config/nix-config/home/programs/vscode/settings.json"; 83 + home.file."${settingsPath}".source = 84 + config.lib.file.mkOutOfStoreSymlink "${builtins.getEnv "HOME"}/.config/nix-config/home/programs/vscode/settings.json"; 74 85 }