mirror of
https://github.com/tomasriveral/nixos.git
synced 2026-08-12 02:28:37 +02:00
desktop: init kdrive
This commit is contained in:
@@ -24,7 +24,7 @@
|
|||||||
};
|
};
|
||||||
systemd.user.services.kdrive-sync = {
|
systemd.user.services.kdrive-sync = {
|
||||||
serviceConfig = {
|
serviceConfig = {
|
||||||
ExecStart = "${pkgs.rclone}/bin/rclone bisync ...";
|
ExecStart = "${self.packages.${pkgs.system}.custom-synckdrive-desktop}/bin/custom-synckdrive";
|
||||||
|
|
||||||
Nice = 19; # lowest CPU scheduling priority
|
Nice = 19; # lowest CPU scheduling priority
|
||||||
IOSchedulingClass = "idle";
|
IOSchedulingClass = "idle";
|
||||||
@@ -97,6 +97,17 @@
|
|||||||
fi
|
fi
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
/*
|
||||||
|
Before setting up we must:
|
||||||
|
* setup the rclone remote
|
||||||
|
`rclone config` choose Webdaw and see login information in bitwarden.
|
||||||
|
* give the good permissions for the hdd
|
||||||
|
`sudo chown -R tomasr:users /home/tomasr/hdd`
|
||||||
|
* Run the bisync once completly
|
||||||
|
`rclone bisync ~/hdd/kdrive/ kdrive: --resync`
|
||||||
|
|
||||||
|
Note : only use the --resync flag once
|
||||||
|
*/
|
||||||
packages.custom-synckdrive-desktop = pkgs.writeShellApplication {
|
packages.custom-synckdrive-desktop = pkgs.writeShellApplication {
|
||||||
name = "custom-synckdrive";
|
name = "custom-synckdrive";
|
||||||
runtimeInputs = with pkgs; [
|
runtimeInputs = with pkgs; [
|
||||||
@@ -105,11 +116,11 @@
|
|||||||
];
|
];
|
||||||
text = ''
|
text = ''
|
||||||
REMOTE_NAME="kdrive"
|
REMOTE_NAME="kdrive"
|
||||||
MOUNT_POINT="/data/kdrive"
|
MOUNT_POINT="/home/tomasr/hdd/kdrive"
|
||||||
|
|
||||||
if rclone listremotes | rg "^''${REMOVE_NAME}:"; then
|
if rclone listremotes | rg "^''${REMOTE_NAME}:"; then
|
||||||
echo "Syncing ''${Syncing} ''${REMOVE_NAME}..."
|
echo "Syncing ''${REMOTE_NAME}..."
|
||||||
rclone sync "''${REMOVE_NAME}:" "$MOUNT_POINT" --allow-non-empty &
|
rclone bisync "''${REMOTE_NAME}:" "$MOUNT_POINT" &
|
||||||
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."
|
||||||
|
|||||||
@@ -31,7 +31,7 @@
|
|||||||
hdd
|
hdd
|
||||||
hyprland
|
hyprland
|
||||||
IO
|
IO
|
||||||
#kdrive-desktop # we will setup this later
|
kdrive-desktop # we will setup this later
|
||||||
latex
|
latex
|
||||||
ly
|
ly
|
||||||
mullvad
|
mullvad
|
||||||
|
|||||||
Reference in New Issue
Block a user