mirror of
https://github.com/nix-community/home-manager.git
synced 2025-12-03 07:31:03 +01:00
42 lines
861 B
Nix
42 lines
861 B
Nix
package:
|
|
|
|
{
|
|
config,
|
|
pkgs,
|
|
lib,
|
|
...
|
|
}:
|
|
|
|
let
|
|
cfg = config.programs.vscode;
|
|
willUseIfd = package.pname != "vscode";
|
|
|
|
settingsPath =
|
|
if pkgs.stdenv.hostPlatform.isDarwin then
|
|
"Library/Application Support/${cfg.nameShort}/User/settings.json"
|
|
else
|
|
".config/${cfg.nameShort}/User/settings.json";
|
|
|
|
expectedSettings = pkgs.writeText "settings-expected.json" ''
|
|
{
|
|
"extensions.autoCheckUpdates": false,
|
|
"update.mode": "none"
|
|
}
|
|
'';
|
|
in
|
|
|
|
lib.mkIf (willUseIfd -> config.test.enableLegacyIfd) {
|
|
programs.vscode = {
|
|
enable = true;
|
|
inherit package;
|
|
profiles.default = {
|
|
enableUpdateCheck = false;
|
|
enableExtensionUpdateCheck = false;
|
|
};
|
|
};
|
|
|
|
nmt.script = ''
|
|
assertFileExists "home-files/${settingsPath}"
|
|
assertFileContent "home-files/${settingsPath}" "${expectedSettings}"
|
|
'';
|
|
}
|