From 8519edda48bf8aa3f0aa09930e9c567ab1d4fdd4 Mon Sep 17 00:00:00 2001 From: TheStachelfisch Date: Thu, 20 Jun 2024 18:05:44 +0200 Subject: [PATCH] psd: add missing module config options --- modules/services/psd.nix | 42 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/modules/services/psd.nix b/modules/services/psd.nix index 477176aa3..a0318908a 100644 --- a/modules/services/psd.nix +++ b/modules/services/psd.nix @@ -4,6 +4,14 @@ let cfg = config.services.psd; + configFile = '' + ${lib.optionalString (cfg.browsers != [ ]) '' + BROWSERS=(${lib.concatStringsSep " " cfg.browsers}) + ''} + + USE_BACKUP="${if cfg.useBackup then "yes" else "no"}" + BACKUP_LIMIT=${builtins.toString cfg.backupLimit} + ''; in { meta.maintainers = [ lib.hm.maintainers.danjujan ]; @@ -22,6 +30,34 @@ in { defaults to seconds if omitted. ''; }; + + browsers = lib.mkOption { + type = lib.types.listOf lib.types.str; + default = [ ]; + example = [ "chromium" "firefox" ]; + description = '' + A list of browsers to sync. An empty list will enable all browsers to be managed by profile-sync-daemon. + + Available choices are: + chromium chromium-dev conkeror.mozdev.org epiphany falkon firefox firefox-trunk google-chrome google-chrome-beta google-chrome-unstable heftig-aurora icecat inox luakit midori opera opera-beta opera-developer opera-legacy otter-browser qupzilla qutebrowser palemoon rekonq seamonkey surf vivaldi vivaldi-snapshot + ''; + }; + + useBackup = lib.mkOption { + type = lib.types.bool; + default = true; + description = '' + Whether to completly enable or disable the crash recovery feature. + ''; + }; + + backupLimit = lib.mkOption { + type = lib.types.ints.unsigned; + default = 5; + description = '' + Maximum number of crash recovery snapshots to keep (the oldest ones are deleted first). + ''; + }; }; config = lib.mkIf cfg.enable { @@ -38,6 +74,10 @@ in { rsync kmod gawk + gnugrep + gnused + coreutils + findutils nettools util-linux profile-sync-daemon @@ -84,5 +124,7 @@ in { Timer = { OnUnitActiveSec = cfg.resyncTimer; }; }; }; + + xdg.configFile."psd/psd.conf".text = configFile; }; }