1 { config, pkgs, lib, ... }:
3 cfg = config.services.psd;
5 options.services.psd = with lib.types; {
6 enable = lib.mkOption {
10 Whether to enable the Profile Sync daemon.
13 resyncTimer = lib.mkOption {
18 The amount of time to wait before syncing browser profiles back to the
21 Takes a systemd.unit time span. The time unit defaults to seconds if
27 config = lib.mkIf cfg.enable {
33 description = "Profile Sync daemon";
34 wants = [ "psd-resync.service" ];
35 wantedBy = [ "default.target" ];
36 path = with pkgs; [ rsync kmod gawk nettools util-linux profile-sync-daemon ];
38 RequiresMountsFor = [ "/home/" ];
42 RemainAfterExit = "yes";
43 ExecStart = "${pkgs.profile-sync-daemon}/bin/profile-sync-daemon sync";
44 ExecStop = "${pkgs.profile-sync-daemon}/bin/profile-sync-daemon unsync";
50 description = "Timed profile resync";
51 after = [ "psd.service" ];
52 wants = [ "psd-resync.timer" ];
53 partOf = [ "psd.service" ];
54 wantedBy = [ "default.target" ];
55 path = with pkgs; [ rsync kmod gawk nettools util-linux profile-sync-daemon ];
58 ExecStart = "${pkgs.profile-sync-daemon}/bin/profile-sync-daemon resync";
64 description = "Timer for profile sync daemon - ${cfg.resyncTimer}";
65 partOf = [ "psd-resync.service" "psd.service" ];
68 OnUnitActiveSec = "${cfg.resyncTimer}";