1
0
Fork 0
mirror of https://github.com/nix-community/home-manager.git synced 2025-03-10 18:57:22 +00:00
home-manager/tests/modules/programs/vscode/update-checks.nix
Reputable2772 e860bd49ea
vscode: add profiles support (#5640)
Adds support for VSCode Profiles configuration. Allowing you to define custom extensions and settings per profile.
2025-02-22 10:58:27 -06:00

34 lines
756 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";
version = "1.75.0";
};
profiles.default = {
enableUpdateCheck = false;
enableExtensionUpdateCheck = false;
};
};
nmt.script = ''
assertFileExists "home-files/${settingsPath}"
assertFileContent "home-files/${settingsPath}" "${expectedSettings}"
'';
}