From fa3e510e3cbc7d26151a2e1b752f1c37fa770cd5 Mon Sep 17 00:00:00 2001 From: Tomas Rivera Date: Fri, 15 May 2026 21:56:54 +0200 Subject: [PATCH] kdrive: add warning if it failed --- hosts/laptop/configuration.nix | 1 + hosts/laptop/home.nix | 2 ++ modules/home-manager/rclone.nix | 5 ++--- modules/home-manager/result | 2 +- modules/scripts/checkKdrive.nix | 33 +++++++++++++++++++++++++++++++++ 5 files changed, 39 insertions(+), 4 deletions(-) create mode 100644 modules/scripts/checkKdrive.nix diff --git a/hosts/laptop/configuration.nix b/hosts/laptop/configuration.nix index baa3f6b..3d6fdb0 100755 --- a/hosts/laptop/configuration.nix +++ b/hosts/laptop/configuration.nix @@ -105,6 +105,7 @@ source = "${pkgs.gpu-screen-recorder}/bin/gsr-kms-server"; }; + # Enable the GNOME Desktop Environment. # services.displayManager.gdm.enable = true; # services.desktopManager.gnome.enable = true; diff --git a/hosts/laptop/home.nix b/hosts/laptop/home.nix index 2b5d28e..7fcc449 100755 --- a/hosts/laptop/home.nix +++ b/hosts/laptop/home.nix @@ -85,6 +85,8 @@ (pkgs.callPackage ../../modules/scripts/man.nix {}) (pkgs.callPackage ../../modules/scripts/trimmer.nix {}) (pkgs.callPackage ../../modules/scripts/syllabes.nix {}) # python script to get number of syllabes in french + (pkgs.callPackage ../../modules/scripts/checkKdrive.nix {}) + (pkgs.callPackage ../../hostsModules/laptop/qt/qtbatticon.nix {}) #pkgs pkgs.gruvbox-gtk-theme diff --git a/modules/home-manager/rclone.nix b/modules/home-manager/rclone.nix index ddb235c..18ca66b 100644 --- a/modules/home-manager/rclone.nix +++ b/modules/home-manager/rclone.nix @@ -1,10 +1,9 @@ { - config, - pkgs, - agenix, + pkgs-unstable, ... }: { programs.rclone = { enable = true; + package = pkgs-unstable.rclone; }; } diff --git a/modules/home-manager/result b/modules/home-manager/result index 7b4d62c..e4b0b2a 120000 --- a/modules/home-manager/result +++ b/modules/home-manager/result @@ -1 +1 @@ -/nix/store/c0iwr0v7bjfka094wv6hd1hjmrkx9hm9-options.json \ No newline at end of file +/nix/store/54sf8q14ygh45qvr20w46b9qcyvdc5ld-options.json \ No newline at end of file diff --git a/modules/scripts/checkKdrive.nix b/modules/scripts/checkKdrive.nix new file mode 100644 index 0000000..7c42dc6 --- /dev/null +++ b/modules/scripts/checkKdrive.nix @@ -0,0 +1,33 @@ +{ + writeShellApplication, + rclone, + matrix-commander-rs, + libnotify, + ... +}: +writeShellApplication { + name = "custom-checkKdrive"; + runtimeInputs = [ + rclone + matrix-commander-rs + libnotify + ]; + text = '' +set +e + +output=$(rclone ls kdrive: 2>&1) +status=$? + +set -e + +if [ $status -eq 0 ]; then + echo "kdrive OK" +else + echo "kdrive rclone failed with error: $output" + notify-send "rclone kdrive failed" "$output" + matrix-commander-rs --verbose -m "rclone kdrive failed.
Error:
$output

@notificationbot_0000" \ + --html \ + -r "\!7j-78_02dHROeLj4Ns8F12eo4IiZGv4zNsQ_1-WlyIU" +fi + ''; +}