anchor.diff:    # for users in group "transmission" to have access to torrents
     fullSettings = { umask = 2; download-dir = downloadDir; incomplete-dir = incompleteDir; } // cfg.settings;
   
  -  # Directories transmission expects to exist and be ug+rwx.
  -  directoriesToManage = [ homeDir settingsDir fullSettings.download-dir fullSettings.incomplete-dir ];
  -
     preStart = pkgs.writeScript "transmission-pre-start" ''
       #!${pkgs.runtimeShell}
       set -ex
  -    for DIR in ${escapeShellArgs directoriesToManage}; do
  +    for DIR in "${homeDir}" "${settingsDir}" "${fullSettings.download-dir}" "${fullSettings.incomplete-dir}"; do
         mkdir -p "$DIR"
  -      chmod 770 "$DIR"
       done
  +    chmod 700 "${homeDir}" "${settingsDir}"
  +    chmod ${downloadDirPermissions} "${fullSettings.download-dir}" "${fullSettings.incomplete-dir}"
       cp -f ${settingsFile} ${settingsDir}/settings.json
     '';
   in
  
positive.code: 
            See https://github.com/transmission/transmission/wiki/Editing-Configuration-Files
            for documentation.
          '';
        };
  
  
negative.code:   apparmor = config.security.apparmor.enable;
  
    homeDir = cfg.home;
    downloadDirPermissions = cfg.downloadDirPermissions;
    downloadDir = "${homeDir}/Downloads";
    incompleteDir = "${homeDir}/.incomplete";
  
  