fix(nix-monitor): make generation checks configurable (#308)

This commit is contained in:
今井 寛大
2026-08-08 20:15:16 -04:00
committed by GitHub
parent c6c0187846
commit 90815dea99
4 changed files with 18 additions and 4 deletions
+3 -2
View File
@@ -41,8 +41,9 @@ Update behavior:
| --- | --- | --- |
| `update_check_interval` | `60` | Minutes between remote revision checks. |
| `update_check_duration_threshold` | `5` | Minutes before an update check is cancelled. |
| `system_stats_check_interval` | `10` | Minutes between store-statistics checks. |
| `system_stats_check_duration_threshold` | `5` | Minutes before a statistics check is cancelled. |
| `generation_check_interval` | `60` | Minutes between NixOS and Home Manager generation checks. |
| `system_stats_check_interval` | `60` | Minutes between store-statistics checks. |
| `system_stats_check_duration_threshold` | `15` | Minutes before a statistics check is cancelled. |
| `show_update_check_notification` | `false` | Notifies when an update check starts and finishes. |
| `show_update_available_notification` | `true` | Notifies when a newer revision is available. |
| `branch` | `nixos-unstable` | Nixpkgs branch compared by the service. |
+2 -1
View File
@@ -37,6 +37,7 @@ end
local branch = cfg("branch")
local updateCheckInterval = cfg("update_check_interval")
local updateCheckDurationThreshold = cfg("update_check_duration_threshold")
local generationsCheckInterval = cfg("generation_check_interval")
local systemStatsCheckInterval = cfg("system_stats_check_interval")
local systemStatsCheckDurationThreshold = cfg("system_stats_check_duration_threshold")
local stateDir = noctalia.pluginDataDir() or "/tmp/nix-monitor"
@@ -292,7 +293,7 @@ function update()
end
-- Generations check
if (os.time() - getState("lastGenerationsCheckTime")) >= 10 then
if (os.time() - getState("lastGenerationsCheckTime")) >= 60 * generationsCheckInterval then
checkGenerations()
end
+9 -1
View File
@@ -1,6 +1,6 @@
id = "avivbintangaringga/nix-monitor"
name = "Nix Monitor"
version = "1.3.0"
version = "1.3.1"
plugin_api = 3
icon = "package"
author = "avivbintangaringga"
@@ -128,6 +128,14 @@ default = 5
min = 1
max = 30
[[setting]]
key = "generation_check_interval"
type = "int"
label_key = "setting.generation_check_interval.label"
description_key = "setting.generation_check_interval.description"
default = 60
min = 1
[[setting]]
key = "system_stats_check_mode"
type = "select"
+4
View File
@@ -40,6 +40,10 @@
"description": "Add 'Press enter to exit' on the terminal window",
"label": "Close on press Enter"
},
"generation_check_interval": {
"description": "How often to check NixOS and Home Manager generations (in minutes)",
"label": "Generation check interval"
},
"hide_clean_button": {
"description": "Whether to hide the clean button on the panel",
"label": "Hide clean button"