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.
This commit is contained in:
Théo Zimmermann 2023-09-19 18:16:45 +02:00
parent 6a20e40aca
commit 714a5a68a3
No known key found for this signature in database
GPG key ID: F1744A0942F536C7

View file

@ -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;