This patch adds a "guix gc" button to the low disk space notification
that 'gsd-housekeeping' emits.
diff --git a/plugins/housekeeping/gsd-disk-space.c b/plugins/housekeeping/gsd-disk-space.c
index bd3437e..89027d8 100644
--- a/plugins/housekeeping/gsd-disk-space.c
+++ b/plugins/housekeeping/gsd-disk-space.c
@@ -546,6 +546,21 @@ empty_trash_callback (NotifyNotification *n,
notify_notification_close (n, NULL);
}
+static void
+guix_gc_callback (NotifyNotification *n,
+ const char *action)
+{
+ const gchar *argv[] = { "guix", "gc", NULL };
+
+ g_assert (action != NULL);
+ g_assert (strcmp (action, "run-guix-gc") == 0);
+
+ g_spawn_async (NULL, (gchar **) argv, NULL, G_SPAWN_SEARCH_PATH,
+ NULL, NULL, NULL, NULL);
+
+ notify_notification_close (n, NULL);
+}
+
static void
on_notification_closed (NotifyNotification *n)
{
@@ -591,6 +606,13 @@ ldsm_notify (const char *summary,
g_free);
}
+ notify_notification_add_action (notification,
+ "run-guix-gc",
+ _("Collect Unused Guix Items"),
+ (NotifyActionCallback) guix_gc_callback,
+ NULL,
+ NULL);
+
has_trash = ldsm_mount_has_trash (mount_path);
if (has_trash) {
ff/tests/guix-shell-export-manifest.sh?id=ab1a473c30e3ac9f9c052f58a150a30b9f212c7f'>diff
|
Age | Commit message (Expand) | Author |
2022-06-16 | shell: Fix '--export-manifest' for cached profiles and when '-p' is used....Fixes <https://issues.guix.gnu.org/55521>.
* guix/scripts/shell.scm (export-manifest): When computing 'manifest',
honor the 'profile key.
* tests/guix-shell-export-manifest.sh: Add test.
| Ludovic Courtès |
2022-06-01 | shell: '--export-manifest -D x -D y' generates a valid manifest....* guix/scripts/shell.scm (manifest->code*): Add missing 'list' in
generated 'concatenate-manifests' call.
* tests/guix-shell-export-manifest.sh: Add test.
| Ludovic Courtès |
2022-04-08 | tests: 'guix shell --export-manifest' test no longer needs networking....* tests/guix-shell-export-manifest.sh: Use '--with-input' rather than
'--with-latest' as the latter would crash in the absence of network
access.
| Ludovic Courtès |
2022-04-04 | shell: Add '--export-manifest'....* guix/scripts/shell.scm (show-help, %options): Add '--export-manifest'.
(manifest-entry-version-prefix, manifest->code*)
(export-manifest): New procedures.
(guix-shell): Honor '--export-manifest'.
* tests/guix-shell-export-manifest.sh: New file.
* Makefile.am (SH_TESTS): Add it.
* doc/guix.texi (Invoking guix shell): Document '--export-manifest'.
(Invoking guix environment): Link to it.
(Invoking guix pack): Likewise.
| Ludovic Courtès |