depot/third_party/home-manager/tests/modules/programs/vscode/update-checks.nix
Default email 2eafb8192e Project import generated by Copybara.
GitOrigin-RevId: 176e455371a8371586e8a3ff0d56ee9f3ca2324e
2023-01-10 02:35:00 -07: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}"
'';
}