feat: adds nextcloud auto syncing

This commit is contained in:
Ahwx 2025-12-15 18:30:32 +01:00
parent e596c6d8ea
commit 5e9482611e
2 changed files with 41 additions and 0 deletions

View file

@ -10,6 +10,7 @@
++ [ (import ./kitty.nix) ]
++ [ (import ./kanshi.nix) ]
++ [ (import ./foot.nix) ]
++ [ (import ./nextcloud.nix) ]
++ [ (import ./nvim.nix) ]
++ [ (import ./zathura.nix) ]
++ [ (import ./packages.nix) ]

View file

@ -0,0 +1,40 @@
{
pkgs,
config,
username,
...
}:
let
nexturl = "cloud.liv.town";
in
{
home.packages = with pkgs; [
nextcloud-client
];
systemd.user = {
services.nextcloud-autosync = {
Unit = {
Description = "Auto sync Nextcloud";
After = "network-online.target";
};
Service = {
Type = "simple";
ExecStart = "${pkgs.nextcloud-client}/bin/nextcloudcmd -h -n --path /music /home/${username}/cloud/music https://${nexturl}";
TimeoutStopSec = "180";
KillMode = "process";
KillSignal = "SIGINT";
};
Install.WantedBy = [ "multi-user.target" ];
};
timers.nextcloud-autosync = {
Unit.Description = "Automatic sync files with Nextcloud when booted up after 5 minutes then rerun every 60 minutes";
Timer.OnBootSec = "5min";
Timer.OnUnitActiveSec = "30min";
Install.WantedBy = [
"multi-user.target"
"timers.target"
];
};
startServices = true;
};
}