mirror of
https://github.com/tomasriveral/nixos.git
synced 2026-08-12 02:28:37 +02:00
Merge pull request #33 from tomasriveral/laptop
Weekly sync: laptop → main
This commit is contained in:
@@ -70,6 +70,7 @@
|
|||||||
"steam"
|
"steam"
|
||||||
"steam-unwrapped"
|
"steam-unwrapped"
|
||||||
"cheatsheet.nvim"
|
"cheatsheet.nvim"
|
||||||
|
"zoom-us" "zoom"
|
||||||
];
|
];
|
||||||
mkUnfreePredicate = pkg:
|
mkUnfreePredicate = pkg:
|
||||||
builtins.elem (inputs.nixpkgs.lib.getName pkg) unfreePkgs;
|
builtins.elem (inputs.nixpkgs.lib.getName pkg) unfreePkgs;
|
||||||
|
|||||||
@@ -53,6 +53,19 @@
|
|||||||
monitor = [
|
monitor = [
|
||||||
", highres@highrr, auto, 0.75"
|
", 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
|
flake.homeModules.hyprland = {pkgs-unstable, ...}: let
|
||||||
|
|||||||
@@ -11,11 +11,12 @@
|
|||||||
enable = true;
|
enable = true;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
flake.nixosModules.kdrive-desktop = {pkgs, ...}: {
|
flake.nixosModules.kdrive-desktop = {pkgs-unstable, ...}: {
|
||||||
environment.systemPackages = [
|
environment.systemPackages = with pkgs-unstable; [
|
||||||
pkgs.rclone
|
rclone
|
||||||
self.packages.${pkgs.system}.custom-checkKdrive
|
icloudpd
|
||||||
self.packages.${pkgs.system}.custom-synckdrive-desktop
|
self.packages.${pkgs-unstable.system}.custom-checkKdrive
|
||||||
|
self.packages.${pkgs-unstable.system}.custom-synckdrive-desktop
|
||||||
];
|
];
|
||||||
# removes rclone error
|
# removes rclone error
|
||||||
programs.fuse = {
|
programs.fuse = {
|
||||||
@@ -24,7 +25,7 @@
|
|||||||
};
|
};
|
||||||
systemd.user.services.kdrive-sync = {
|
systemd.user.services.kdrive-sync = {
|
||||||
serviceConfig = {
|
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
|
Nice = 19; # lowest CPU scheduling priority
|
||||||
IOSchedulingClass = "idle";
|
IOSchedulingClass = "idle";
|
||||||
@@ -34,15 +35,13 @@
|
|||||||
CPUWeight = 1; # minimum relative CPU share
|
CPUWeight = 1; # minimum relative CPU share
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
/*
|
|
||||||
systemd.user.timers.kdrive-sync = {
|
systemd.user.timers.kdrive-sync = {
|
||||||
wantedBy = [ "timers.target" ];
|
wantedBy = [ "timers.target" ];
|
||||||
timerConfig = {
|
timerConfig = {
|
||||||
OnBootSec = "1m";
|
OnBootSec = "10m";
|
||||||
OnUnitActiveSec = "5m";
|
OnUnitActiveSec = "1h";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
*/
|
|
||||||
};
|
};
|
||||||
perSystem = {pkgs, ...}: {
|
perSystem = {pkgs, ...}: {
|
||||||
packages.custom-checkKdrive = pkgs.writeShellApplication {
|
packages.custom-checkKdrive = pkgs.writeShellApplication {
|
||||||
@@ -115,18 +114,25 @@
|
|||||||
runtimeInputs = with pkgs; [
|
runtimeInputs = with pkgs; [
|
||||||
rclone
|
rclone
|
||||||
libnotify
|
libnotify
|
||||||
|
ripgrep
|
||||||
];
|
];
|
||||||
text = ''
|
text = ''
|
||||||
REMOTE_NAME="kdrive"
|
REMOTE_NAME="kdrive"
|
||||||
MOUNT_POINT="/home/tomasr/hdd/kdrive"
|
MOUNT_POINT="/home/tomasr/hdd/kdrive"
|
||||||
|
LOGFILE="/tmp/rclone-bisync.log"
|
||||||
if rclone listremotes | rg "^''${REMOTE_NAME}:"; then
|
rm LOGFILE && touch LOGFILE
|
||||||
|
if rclone --config "$HOME/.config/rclone/rclone.conf" listremotes | rg "^''${REMOTE_NAME}:"; then
|
||||||
echo "Syncing ''${REMOTE_NAME}..."
|
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
|
else
|
||||||
notify-send "rclone sync failed" \
|
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."
|
"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
|
fi
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -11,6 +11,7 @@
|
|||||||
self.packages.${pkgs.system}.custom-checkMatrix
|
self.packages.${pkgs.system}.custom-checkMatrix
|
||||||
self.packages.${pkgs.system}.custom-gitnotify # checks if git is set up
|
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
|
self.packages.${pkgs.system}.custom-checkKdrive # check if kdrive is set up with rclone
|
||||||
|
zoom-us
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
perSystem = {pkgs, ...}: {
|
perSystem = {pkgs, ...}: {
|
||||||
|
|||||||
@@ -54,7 +54,9 @@
|
|||||||
"https://github.com/tomasriveral/notewrapper.git"
|
"https://github.com/tomasriveral/notewrapper.git"
|
||||||
"https://github.com/tomasriveral/fractal-cli.git"
|
"https://github.com/tomasriveral/fractal-cli.git"
|
||||||
"https://github.com/tomasriveral/boids.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"
|
LOCAL_BACKUP_DIR="$HOME/.gitBackups"
|
||||||
|
|||||||
Reference in New Issue
Block a user