From a619a10851e1d3936b09f0665114a81cdd3abce5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1s=20Rivera?= Date: Thu, 18 Jun 2026 19:47:29 +0200 Subject: [PATCH] icloud backup with kdrive --- modules/applications/hyprland.nix | 13 +++++++++++++ modules/applications/kdrive.nix | 13 +++++++------ 2 files changed, 20 insertions(+), 6 deletions(-) diff --git a/modules/applications/hyprland.nix b/modules/applications/hyprland.nix index d851950..99685ed 100644 --- a/modules/applications/hyprland.nix +++ b/modules/applications/hyprland.nix @@ -53,6 +53,19 @@ monitor = [ ", highres@highrr, auto, 0.75" ]; + exec-once = [ + "if [ -e \"/home/tomasr/icloudSync.sh\" ]; then /home/tomasr/icloudSync.sh; else notify-send \"icloudSync.sh doesn't exist\" \"See ~/nixos/modules/applications/hyprland.nix for more information\"; fi" + # my icloud account uses an email that I don't want to make public. So the script isnt pushed to github. The script looks like: + /* + #!/etc/profiles/per-user/tomasr/bin/zsh + if ! icloudpd --auth-only --username tomas.rivera_2009@icloud.com --dry-run; then + notify-send "icloudpd is not logged in" "Please run icloudpd icloudpd --username my@email.address --password my_password --auth-only" + exit 1 + fi + icloudpd --directory ~/hdd/kdrive/Photo/IPhone/icloudpd-backup --username tomas.rivera_2009@icloud.com --watch-with-interval 3600 --no-progress-bar + */ + + ]; }; }; flake.homeModules.hyprland = {pkgs-unstable, ...}: let diff --git a/modules/applications/kdrive.nix b/modules/applications/kdrive.nix index 3522eb7..f34b115 100644 --- a/modules/applications/kdrive.nix +++ b/modules/applications/kdrive.nix @@ -11,11 +11,12 @@ enable = true; }; }; - flake.nixosModules.kdrive-desktop = {pkgs, ...}: { - environment.systemPackages = [ - pkgs.rclone - self.packages.${pkgs.system}.custom-checkKdrive - self.packages.${pkgs.system}.custom-synckdrive-desktop + flake.nixosModules.kdrive-desktop = {pkgs-unstable, ...}: { + environment.systemPackages = with pkgs-unstable; [ + rclone + icloudpd + self.packages.${pkgs-unstable.system}.custom-checkKdrive + self.packages.${pkgs-unstable.system}.custom-synckdrive-desktop ]; # removes rclone error programs.fuse = { @@ -24,7 +25,7 @@ }; systemd.user.services.kdrive-sync = { serviceConfig = { - ExecStart = "${self.packages.${pkgs.system}.custom-synckdrive-desktop}/bin/custom-synckdrive"; + ExecStart = "${self.packages.${pkgs-unstable.system}.custom-synckdrive-desktop}/bin/custom-synckdrive"; Nice = 19; # lowest CPU scheduling priority IOSchedulingClass = "idle";