Merge pull request #33 from tomasriveral/laptop

Weekly sync: laptop → main
This commit is contained in:
github-actions[bot]
2026-06-22 18:12:48 +00:00
committed by GitHub
5 changed files with 38 additions and 15 deletions
+1
View File
@@ -70,6 +70,7 @@
"steam"
"steam-unwrapped"
"cheatsheet.nvim"
"zoom-us" "zoom"
];
mkUnfreePredicate = pkg:
builtins.elem (inputs.nixpkgs.lib.getName pkg) unfreePkgs;
+13
View File
@@ -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
+20 -14
View File
@@ -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";
@@ -34,15 +35,13 @@
CPUWeight = 1; # minimum relative CPU share
};
};
/*
systemd.user.timers.kdrive-sync = {
wantedBy = [ "timers.target" ];
timerConfig = {
OnBootSec = "1m";
OnUnitActiveSec = "5m";
OnBootSec = "10m";
OnUnitActiveSec = "1h";
};
};
*/
};
perSystem = {pkgs, ...}: {
packages.custom-checkKdrive = pkgs.writeShellApplication {
@@ -115,18 +114,25 @@
runtimeInputs = with pkgs; [
rclone
libnotify
ripgrep
];
text = ''
REMOTE_NAME="kdrive"
MOUNT_POINT="/home/tomasr/hdd/kdrive"
if rclone listremotes | rg "^''${REMOTE_NAME}:"; then
LOGFILE="/tmp/rclone-bisync.log"
rm LOGFILE && touch LOGFILE
if rclone --config "$HOME/.config/rclone/rclone.conf" listremotes | rg "^''${REMOTE_NAME}:"; then
echo "Syncing ''${REMOTE_NAME}..."
rclone bisync "''${REMOTE_NAME}:" "$MOUNT_POINT" &
if ! rclone --config "$HOME/.config/rclone/rclone.conf" bisync "$MOUNT_POINT" "$REMOTE_NAME:" --recover > "$LOGFILE" 2>&1; then
notify-send "rclone bisync failed" "$(cat $LOGFILE)"
echo "rclone bisync failed"
cat $LOGFILE
cp $LOGFILE "$HOME/hdd/kdrive/logs/$(date +%Y-%m-%d-%H-%M-%S).log"
fi
else
notify-send "rclone sync failed" \
"Remote ''${REMOTE_NAME} not found.\nConfigure rclone and create the dir ~/kdrive/ or comment out the exec line in hyprland.nix."
echo "Remote ''${REMOTE_NAME} not found. Configure rclone or comment out the exec line in hyprland.nix."
echo "Remote ''${REMOTE_NAME} not found. Configure rclone or fix in ~/nixos/modules/applications/kdrive.nix"
fi
'';
};
@@ -11,6 +11,7 @@
self.packages.${pkgs.system}.custom-checkMatrix
self.packages.${pkgs.system}.custom-gitnotify # checks if git is set up
self.packages.${pkgs.system}.custom-checkKdrive # check if kdrive is set up with rclone
zoom-us
];
};
perSystem = {pkgs, ...}: {
+3 -1
View File
@@ -54,7 +54,9 @@
"https://github.com/tomasriveral/notewrapper.git"
"https://github.com/tomasriveral/fractal-cli.git"
"https://github.com/tomasriveral/boids.git"
"https://github.com/tomasriveral/Nixpkgs-tracker-notifier.git"
"https://github.com/tomasriveral/nixpkgs-notifier.git"
"https://github.com/tomasriveral/Nix-Git-Cherry-Picker.git"
"https://github.com/tomasriveral/ReSSPublica.git"
)
LOCAL_BACKUP_DIR="$HOME/.gitBackups"