From 714a5a68a3c0432adc20ca0709ad2b6f9e0b1b23 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9o=20Zimmermann?= Date: Tue, 19 Sep 2023 18:16:45 +0200 Subject: [PATCH] programs.vscode: add option to disable auto updates for extensions The current `enableExtensionUpdateCheck` is confusing because it does not prevent VS Code from auto-updating extensions that were installed declaratively. The new `enableExtensionUpdate` option probably matches what most users would like better, by disabling both the update notifications and the auto-updates. Perhaps the `enableExtensionUpdateCheck` option should even be deprecated in favor of this new one. --- modules/programs/vscode.nix | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/modules/programs/vscode.nix b/modules/programs/vscode.nix index 5ea6be8b4..dc4278d4f 100644 --- a/modules/programs/vscode.nix +++ b/modules/programs/vscode.nix @@ -48,6 +48,9 @@ let // optionalAttrs (!cfg.enableUpdateCheck) { "update.mode" = "none"; } // optionalAttrs (!cfg.enableExtensionUpdateCheck) { "extensions.autoCheckUpdates" = false; + } // optionalAttrs (!cfg.enableExtensionUpdate) { + "extensions.autoUpdate" = false; + "extensions.autoCheckUpdates" = false; }; in { imports = [ @@ -80,6 +83,15 @@ in { ''; }; + enableExtensionUpdate = mkOption { + type = types.bool; + default = true; + description = '' + Whether to enable automatic extension updates. + Disabling this also disables update checks. + ''; + }; + enableExtensionUpdateCheck = mkOption { type = types.bool; default = true;