You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For a manual installation, download the `update-checker` script, put it in your [PATH](https://unix.stackexchange.com/a/26059) and make it executable (`chmod +x update-checker`). Add the icons to your ~/.icons folder.
114
104
115
-
### Configuration Options
105
+
### ⚙️ Configuration Options
116
106
You can modify these variables at the top of the script to customize behavior:
117
107
118
108
-`UPDATE_INTERVAL`: Time in seconds between update checks (default: 3599)
@@ -122,7 +112,13 @@ You can modify these variables at the top of the script to customize behavior:
122
112
-`GRACE_PERIOD`: Time in seconds to wait after boot/resume before checking (default: 60)
123
113
-`UPDATE_LOCK_FILE`: Whether to update the lock file directly or use a temporary copy (default: false)
124
114
125
-
### Waybar Integration
115
+
### 🔄 Toggle Functionality
116
+
The script supports toggling update checks on/off. When disabled, it will show the last known state without performing new checks:
117
+
- To toggle: Run `update-checker toggle`
118
+
- The toggle state is preserved across restarts
119
+
- When disabled, the module shows "disabled" state with the last check timestamp
120
+
121
+
### 🎨 Waybar Integration
126
122
127
123
If you're using the Home Manager module, the waybar configuration is automatically provided through `config.programs.waybar-nixos-updates.waybarConfig`. Otherwise, configure manually:
128
124
@@ -133,7 +129,7 @@ In json (if adding directly to the config file):
133
129
"custom/nix-updates": {
134
130
"exec": "$HOME/bin/update-checker", // <--- path to script
To style use the `#custom-nix-updates` ID in your Waybar styles file (`~/.config/waybar/styles.css`). For more information see the [Waybar wiki](https://github.com/Alexays/Waybar/wiki).
178
176
179
-
### Complete Configuration Example
177
+
### 💡 Complete Configuration Example
180
178
181
179
Here's a complete example of using waybar-nixos-updates with Home Manager:
182
180
@@ -227,6 +225,10 @@ Here's a complete example of using waybar-nixos-updates with Home Manager:
227
225
#custom-nix-updates.updating {
228
226
color: #f9e2af;
229
227
}
228
+
#custom-nix-updates.disabled {
229
+
color: #6c7086;
230
+
opacity: 0.7;
231
+
}
230
232
#custom-nix-updates.error {
231
233
color: #eba0ac;
232
234
}
@@ -240,7 +242,7 @@ Here's a complete example of using waybar-nixos-updates with Home Manager:
240
242
}
241
243
```
242
244
243
-
### Flake Outputs
245
+
### 📤 Flake Outputs
244
246
245
247
The flake provides the following outputs:
246
248
@@ -249,9 +251,9 @@ The flake provides the following outputs:
249
251
-**nixosModules.default**: NixOS module for system-level installation
250
252
-**apps.default**: Direct execution of the update-checker script
251
253
252
-
### Troubleshooting
254
+
### 🔍 Troubleshooting
253
255
254
-
#### Common Issues and Solutions
256
+
#### 🐛 Common Issues and Solutions
255
257
256
258
1.**Script not finding NixOS configuration**
257
259
- Ensure your configuration is at `~/.config/nixos` or update the `nixosConfigPath` option
@@ -279,10 +281,10 @@ The flake provides the following outputs:
279
281
- When using the wrapper script, restart waybar after rebuilding
280
282
- Verify the correct script is being executed: check waybar config `exec` path
281
283
282
-
### System Integration
284
+
### ⚡ System Integration
283
285
You can integrate the updater with your system by modifying your flake update script and your rebuild script to pass the UPDATE_FLAG variable and the REBUILD_FLAG variable, respectively.
284
286
285
-
#### Your Flake Update Script and the UPDATE_FLAG
287
+
#### 🔄 Your Flake Update Script and the UPDATE_FLAG
286
288
You can integrate your system to control the UPDATE_FLAG, which is saved in the "nix-update-update-flag" cache file. If you have UPDATE_LOCK_FILE set to "true", no further action is required. The program will detect if your lock file has been updated. If you have UPDATE_LOCK_FILE set to "false", the "nix-update-update-flag" file will signal that your lock file has been updated.
287
289
288
290
To integrate the update checker with your system, add the following to the update script you use to update your system's lock file (i.e. your "nix flake update" script), so that the output of nvd diff is piped in:
@@ -298,7 +300,7 @@ checkup =
298
300
popd";
299
301
```
300
302
301
-
#### Your Rebuild Script and the REBUILD_FLAG
303
+
#### 🏗️ Your Rebuild Script and the REBUILD_FLAG
302
304
The REBUILD_FLAG, which is saved in the "nix-update-rebuild-flag" cache file, signals this script to run after your system has been rebuilt. Add this to your update script to create the REBUILD_FLAG and send a signal to waybar to refresh after updating:
303
305
`if [ -f \"$HOME/.cache/nix-update-update-flag\" ]; then touch \"$HOME/.cache/nix-update-rebuild-flag\" && pkill -x -RTMIN+12 .waybar-wrapped; fi &&`
304
306
@@ -315,10 +317,10 @@ nixup =
315
317
popd";
316
318
```
317
319
318
-
## Additional Information
320
+
## ℹ️ Additional Information
319
321
Some additional things to expect in regards to 1) what notifications you'll receive, 2) what files will be written, 3) and how the script uses your network connection.
320
322
321
-
### Notifications
323
+
### 🔔 Notifications
322
324
These notifications require `notify-send` to be installed on your system. The script sends desktop notifications to keep you informed:
323
325
- When starting an update check: "Checking for Updates - Please be patient"
324
326
- When throttled due to recent checks: "Please Wait" with time until next check
@@ -327,28 +329,28 @@ These notifications require `notify-send` to be installed on your system. The sc
327
329
- When connectivity fails: "Update Check Failed - Not connected to the internet"
328
330
- When an update fails: "Update Check Failed - Check tooltip for detailed error message"
329
331
330
-
### Cache Files
332
+
### 💾 Cache Files
331
333
The script uses several cache files in your ~/.cache directory:
332
334
-`nix-update-state`: Stores the current number of available updates
333
335
-`nix-update-last-run`: Tracks when the last update check was performed
334
336
-`nix-update-tooltip`: Contains the tooltip text with update details
335
337
-`nix-update-boot-marker`: Used to detect system boot/resume events
338
+
-`nix-update-toggle`: Stores the enabled/disabled state for update checking
336
339
-`nix-update-update-flag`: Signals that your lock file has been updated
337
340
-`nix-update-rebuild-flag`: Signals that your system has been rebuilt
338
341
-`nix-update-updating-flag`: Signals that an update process is currently performing
339
342
340
-
### Privacy and Security Considerations
341
-
Aside from checking repos for updates, this script uses external network requests to check for internet connectivity.
342
-
343
-
In regards to external network requests, the script uses `ping -c 1 -W 2 8.8.8.8` to check network connectivity and sends packets to Google's DNS servers (8.8.8.8), which could potentially reveal:
344
-
- That your system is running and online
345
-
- The fact you're using this specific script
346
-
- Your IP address to Google's DNS infrastructure
343
+
### 🔒 Privacy and Security Considerations
344
+
The script checks network connectivity locally using the `ip` command to verify network interfaces and routing tables. This approach:
345
+
- Does not send any external network requests for connectivity checking
346
+
- Only checks local network configuration (interfaces and routes)
347
+
- Performs actual network requests only when fetching updates from configured Nix repositories
348
+
- Provides better privacy as no external connectivity checks are performed
347
349
348
-
## Contributing
350
+
## 🤝 Contributing
349
351
350
352
PRs are welcome! Please test your changes and ensure they work with both the flake installation methods and manual installation.
351
353
352
-
## License
354
+
## 📜 License
353
355
354
356
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
0 commit comments