From 4e8d165892ba04a6d1ae8f6275f88c7231c33835 Mon Sep 17 00:00:00 2001 From: Jelle Spreeuwenberg Date: Wed, 9 Sep 2026 17:32:08 +0200 Subject: [PATCH] feat: declare two SharePoint reference mirrors on Zenith Preserve the latest working-tree configuration: hourly rclone sync into Algemeen and Projecten, private file creation and a 100-deletion limit per invocation. Only rclone.conf gates the service; the earlier environment-file gate is removed. Flake evaluation passed. Consent, synchronization and active service state were not checked during cleanup. --- modules/capabilities/sharepoint-reference.nix | 47 +++++++++++++++++++ modules/hosts/zenith/default.nix | 1 + 2 files changed, 48 insertions(+) create mode 100644 modules/capabilities/sharepoint-reference.nix diff --git a/modules/capabilities/sharepoint-reference.nix b/modules/capabilities/sharepoint-reference.nix new file mode 100644 index 0000000..d27fe28 --- /dev/null +++ b/modules/capabilities/sharepoint-reference.nix @@ -0,0 +1,47 @@ +{ config, ... }: +{ + flake.modules.homeManager.sharepoint-reference = + { + config, + lib, + pkgs, + ... + }: + let + rcloneConfig = "${config.xdg.configHome}/rclone/rclone.conf"; + destination = "${config.xdg.dataHome}/yookr-reference/sharepoint"; + in + { + systemd.user.services.sharepoint-reference-sync = { + Unit = { + Description = "Refresh the local SharePoint reference mirror"; + ConditionPathExists = rcloneConfig; + }; + + Service = { + Type = "oneshot"; + UMask = "0077"; + ExecStart = [ + "${lib.getExe pkgs.rclone} --config ${rcloneConfig} sync company-sharepoint: ${destination}/Algemeen --max-delete 100" + "${lib.getExe pkgs.rclone} --config ${rcloneConfig} sync company-sharepoint-projecten: ${destination}/Projecten --max-delete 100" + ]; + }; + }; + + systemd.user.timers.sharepoint-reference-sync = { + Unit.Description = "Refresh the local SharePoint reference mirror hourly"; + + Timer = { + OnCalendar = "hourly"; + Persistent = true; + RandomizedDelaySec = "10m"; + }; + + Install.WantedBy = [ "timers.target" ]; + }; + }; + + flake.modules.nixos.sharepoint-reference = { + home-manager.sharedModules = [ config.flake.modules.homeManager.sharepoint-reference ]; + }; +} diff --git a/modules/hosts/zenith/default.nix b/modules/hosts/zenith/default.nix index a89f047..9d6052e 100644 --- a/modules/hosts/zenith/default.nix +++ b/modules/hosts/zenith/default.nix @@ -32,6 +32,7 @@ in imports = [ nixosModules.workstation-base nixosModules.laptop-power + nixosModules.sharepoint-reference ./_hardware.nix inputs.nixos-hardware.nixosModules.lenovo-yoga-7-14ARH7-amdgpu ];