aboutsummaryrefslogtreecommitdiff
path: root/modules/services/muchsync.nix
diff options
context:
space:
mode:
authorRobert Helgesson <robert@rycee.net>2020-02-02 00:39:17 +0100
committerRobert Helgesson <robert@rycee.net>2020-02-02 01:07:28 +0100
commit45abf3d38a2b51c00c347cab6950f3734e023bba (patch)
tree414fde5d14d1d075fa65e59175660fd1fb680c43 /modules/services/muchsync.nix
parent9799d3de2d270a9c40fcf81d600bfd71088e144d (diff)
Apply `nixfmt` on many files
Diffstat (limited to 'modules/services/muchsync.nix')
-rw-r--r--modules/services/muchsync.nix38
1 files changed, 15 insertions, 23 deletions
diff --git a/modules/services/muchsync.nix b/modules/services/muchsync.nix
index 72bf737c27d..b7004418d35 100644
--- a/modules/services/muchsync.nix
+++ b/modules/services/muchsync.nix
@@ -150,23 +150,21 @@ in {
};
config = let
- mapRemotes = gen: with attrsets; mapAttrs'
+ mapRemotes = gen:
+ with attrsets;
+ mapAttrs'
(name: remoteCfg: nameValuePair "muchsync-${name}" (gen name remoteCfg))
cfg.remotes;
in mkIf (cfg.remotes != { }) {
- assertions = [
- {
- assertion = config.programs.notmuch.enable;
- message = ''
- The muchsync module requires 'programs.notmuch.enable = true'.
- '';
- }
- ];
+ assertions = [{
+ assertion = config.programs.notmuch.enable;
+ message = ''
+ The muchsync module requires 'programs.notmuch.enable = true'.
+ '';
+ }];
systemd.user.services = mapRemotes (name: remoteCfg: {
- Unit = {
- Description = "muchsync sync service (${name})";
- };
+ Unit = { Description = "muchsync sync service (${name})"; };
Service = {
CPUSchedulingPolicy = "idle";
IOSchedulingClass = "idle";
@@ -175,8 +173,7 @@ in {
''"NOTMUCH_CONFIG=${config.home.sessionVariables.NOTMUCH_CONFIG}"''
''"NMBGIT=${config.home.sessionVariables.NMBGIT}"''
];
- ExecStart = concatStringsSep " " (
- [ "${pkgs.muchsync}/bin/muchsync" ]
+ ExecStart = concatStringsSep " " ([ "${pkgs.muchsync}/bin/muchsync" ]
++ [ "-s ${escapeShellArg remoteCfg.sshCommand}" ]
++ optional (!remoteCfg.upload) "--noup"
@@ -187,25 +184,20 @@ in {
# remote configuration
++ [ (escapeShellArg remoteCfg.remote.host) ]
++ optional (remoteCfg.remote.muchsyncPath != "")
- "-r ${escapeShellArg remoteCfg.remote.muchsyncPath}"
+ "-r ${escapeShellArg remoteCfg.remote.muchsyncPath}"
++ optional remoteCfg.remote.checkForModifiedFiles "-F"
- ++ optional (!remoteCfg.remote.importNew) "--nonew"
- );
+ ++ optional (!remoteCfg.remote.importNew) "--nonew");
};
});
systemd.user.timers = mapRemotes (name: remoteCfg: {
- Unit = {
- Description = "muchsync periodic sync (${name})";
- };
+ Unit = { Description = "muchsync periodic sync (${name})"; };
Timer = {
Unit = "muchsync-${name}.service";
OnCalendar = remoteCfg.frequency;
Persistent = true;
};
- Install = {
- WantedBy = [ "timers.target" ];
- };
+ Install = { WantedBy = [ "timers.target" ]; };
});
};
}