mirror of
https://github.com/nix-community/home-manager.git
synced 2026-10-03 12:09:19 +00:00
programs.vscode.profiles.<name>.userSettings accepts either JSON settings or a path to a settings.json file. The update-check defaults were merged into userSettings before deciding whether to generate JSON or link a source file, so path values failed when Nix tried to apply // to them. Skip those merges for path-like values and use the shared isPathLike helper for VS Code's source-or-generated JSON options so Nix paths, store path strings, and derivation outputs are handled consistently. Fixes #7726
34 lines
625 B
Nix
34 lines
625 B
Nix
package:
|
|
|
|
{
|
|
pkgs,
|
|
...
|
|
}:
|
|
|
|
let
|
|
settingsPath =
|
|
if pkgs.stdenv.hostPlatform.isDarwin then
|
|
"Library/Application Support/Code/User/settings.json"
|
|
else
|
|
".config/Code/User/settings.json";
|
|
in
|
|
|
|
{
|
|
programs.vscode = {
|
|
enable = true;
|
|
inherit package;
|
|
profiles = {
|
|
default = {
|
|
userSettings = ./path-literal-settings.json;
|
|
enableUpdateCheck = false;
|
|
enableExtensionUpdateCheck = false;
|
|
};
|
|
};
|
|
};
|
|
|
|
nmt.script = ''
|
|
assertFileExists "home-files/${settingsPath}"
|
|
assertFileContent "home-files/${settingsPath}" "${./path-literal-settings.json}"
|
|
'';
|
|
}
|