vscode: add options to disable update checks
Update notification popups are annoying when vscode/vscodium is managed by Home Manager. However, as these settings also require the configuration to be managed via `userSettings`, they are disabled by default.
This commit is contained in:
parent
32fe7d2ebb
commit
d3f21617ac
4 changed files with 69 additions and 8 deletions
|
|
@ -34,6 +34,11 @@ let
|
|||
# TODO: On Darwin where are the extensions?
|
||||
extensionPath = ".${extensionDir}/extensions";
|
||||
|
||||
mergedUserSettings = cfg.userSettings
|
||||
// optionalAttrs (!cfg.enableUpdateCheck) { "update.mode" = "none"; }
|
||||
// optionalAttrs (!cfg.enableExtensionUpdateCheck) {
|
||||
"extensions.autoCheckUpdates" = false;
|
||||
};
|
||||
in {
|
||||
imports = [
|
||||
(mkChangedOptionModule [ "programs" "vscode" "immutableExtensionsDir" ] [
|
||||
|
|
@ -56,12 +61,28 @@ in {
|
|||
'';
|
||||
};
|
||||
|
||||
enableUpdateCheck = mkOption {
|
||||
type = types.bool;
|
||||
default = true;
|
||||
description = ''
|
||||
Whether to enable update checks/notifications.
|
||||
'';
|
||||
};
|
||||
|
||||
enableExtensionUpdateCheck = mkOption {
|
||||
type = types.bool;
|
||||
default = true;
|
||||
description = ''
|
||||
Whether to enable update notifications for extensions.
|
||||
'';
|
||||
};
|
||||
|
||||
userSettings = mkOption {
|
||||
type = jsonFormat.type;
|
||||
default = { };
|
||||
example = literalExpression ''
|
||||
{
|
||||
"update.channel" = "none";
|
||||
"files.autoSave" = "off"
|
||||
"[nix]"."editor.tabSize" = 2;
|
||||
}
|
||||
'';
|
||||
|
|
@ -164,9 +185,9 @@ in {
|
|||
home.packages = [ cfg.package ];
|
||||
|
||||
home.file = mkMerge [
|
||||
(mkIf (cfg.userSettings != { }) {
|
||||
(mkIf (mergedUserSettings != { }) {
|
||||
"${configFilePath}".source =
|
||||
jsonFormat.generate "vscode-user-settings" cfg.userSettings;
|
||||
jsonFormat.generate "vscode-user-settings" mergedUserSettings;
|
||||
})
|
||||
(mkIf (cfg.userTasks != { }) {
|
||||
"${tasksFilePath}".source =
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue