Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

psd: add missing module config options #5558

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 42 additions & 0 deletions modules/services/psd.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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 ];

Expand All @@ -22,6 +30,34 @@ in {
defaults to seconds if omitted.
'';
};

browsers = lib.mkOption {
type = lib.types.listOf lib.types.str;
default = [ ];
example = [ "chromium" "google-chrome" "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 {
Expand All @@ -38,6 +74,10 @@ in {
rsync
kmod
gawk
gnugrep
gnused
coreutils
findutils
nettools
util-linux
profile-sync-daemon
Expand Down Expand Up @@ -84,5 +124,7 @@ in {
Timer = { OnUnitActiveSec = cfg.resyncTimer; };
};
};

xdg.configFile."psd/psd.conf".text = configFile;
};
}
Loading