aboutsummaryrefslogtreecommitdiff
path: root/modules/home-manager/nextcloud.nix
diff options
context:
space:
mode:
Diffstat (limited to 'modules/home-manager/nextcloud.nix')
-rw-r--r--modules/home-manager/nextcloud.nix39
1 files changed, 39 insertions, 0 deletions
diff --git a/modules/home-manager/nextcloud.nix b/modules/home-manager/nextcloud.nix
new file mode 100644
index 0000000..6e8774f
--- /dev/null
+++ b/modules/home-manager/nextcloud.nix
@@ -0,0 +1,39 @@
+{ config, lib, pkgs, ... }:
+
+let
+ cfg = config.nextcloud;
+in {
+ options.nextcloud.enable = lib.mkEnableOption "Enable nextcloud and setup";
+ config = lib.mkIf cfg.enable {
+ home.file.".netrc".text = ''default
+ login exmaple
+ password test123
+ '';
+
+ home.packages = 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 https://cloud.schererleander.de";
+ 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 = "60min";
+ Install.WantedBy = ["multi-user.target" "timers.target"];
+ };
+ startServices = true;
+ };
+ };
+}