diff --git a/configs/cloud.nix b/configs/cloud.nix index 168a6e7..e005910 100644 --- a/configs/cloud.nix +++ b/configs/cloud.nix @@ -15,14 +15,6 @@ in { }; systemd.tmpfiles.rules = map tmpfilesConfig [ - { - type = "L+"; - user = config.users.users.me.name; - group = "users"; - mode = "0755"; - argument = "${config.users.users.me.home}/cloud/Seafile/Wiki"; - path = "${config.users.users.me.home}/notes"; - } { type = "L+"; user = config.users.users.me.name; @@ -55,6 +47,28 @@ in { }; }; + systemd.user.services.nextcloud-syncer = { + enable = true; + wants = ["network-online.target"]; + wantedBy = ["default.target"]; + startAt = "*:00/10"; + script = let + kieran = { + user = "kieran"; + password = lib.fileContents ; + endpoint = "https://cloud.xn--kiern-0qa.de"; + }; + in '' + KIERAN_TARGET=${config.users.users.me.home}/notes + mkdir -p "$KIERAN_TARGET" + ${pkgs.nextcloud-client}/bin/nextcloudcmd --user ${kieran.user} --password ${lib.escapeShellArg kieran.password} --path /Notes "$KIERAN_TARGET" ${kieran.endpoint} + ''; + serviceConfig = { + Type = "oneshot"; + Restart = "on-failure"; + }; + }; + environment.systemPackages = [ (pkgs.writers.writeDashBin "book" '' set -efu