1
0
Fork 0
mirror of https://github.com/nix-community/home-manager synced 2024-11-01 08:49:44 +01:00
home-manager/tests/modules/programs/vscode/update-checks.nix
Markus S. Wamser d3f21617ac
vscode: add options to disable update checks
Update notification popups are annoying when vscode/vscodium is
managed by Home Manager. However, as these settings also require the
configuration to be managed via `userSettings`, they are disabled by
default.
2022-10-27 18:16:03 +02:00

29 lines
684 B
Nix

{ pkgs, ... }:
let
settingsPath = if pkgs.stdenv.hostPlatform.isDarwin then
"Library/Application Support/Code/User/settings.json"
else
".config/Code/User/settings.json";
expectedSettings = pkgs.writeText "settings-expected.json" ''
{
"extensions.autoCheckUpdates": false,
"update.mode": "none"
}
'';
in {
programs.vscode = {
enable = true;
package = pkgs.writeScriptBin "vscode" "" // { pname = "vscode"; };
enableUpdateCheck = false;
enableExtensionUpdateCheck = false;
};
nmt.script = ''
assertFileExists "home-files/${settingsPath}"
assertFileContent "home-files/${settingsPath}" "${expectedSettings}"
'';
}