mirror of
https://github.com/Ahwxorg/nixos-config.git
synced 2025-12-26 10:44:57 +08:00
feat: adds nextcloud auto syncing
This commit is contained in:
parent
e596c6d8ea
commit
5e9482611e
2 changed files with 41 additions and 0 deletions
|
|
@ -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) ]
|
||||
|
|
|
|||
40
modules/home/nextcloud.nix
Normal file
40
modules/home/nextcloud.nix
Normal 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;
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue