anchor.diff:    };
   
     config = mkIf cfg.enable {
  +    systemd.tmpfiles.rules = [
  +      "d '${homeDir}' 0770 '${cfg.user}' '${cfg.group}' - -"
  +      "d '${settingsDir}' 0700 '${cfg.user}' '${cfg.group}' - -"
  +      "d '${fullSettings.download-dir}' '${downloadDirPermissions}' '${cfg.user}' '${cfg.group}' - -"
  +      "d '${fullSettings.incomplete-dir}' '${downloadDirPermissions}' '${cfg.user}' '${cfg.group}' - -"
  +    ];
  +
       systemd.services.transmission = {
         description = "Transmission BitTorrent Service";
         after = [ "network.target" ] ++ optional apparmor "apparmor.service";
  
positive.code:   downloadDir = "${homeDir}/Downloads";
    incompleteDir = "${homeDir}/.incomplete";
  
    settingsDir = "${homeDir}/.config/transmission-daemon";
    settingsFile = pkgs.writeText "settings.json" (builtins.toJSON fullSettings);
  
    # for users in group "transmission" to have access to torrents
  
negative.code:   preStart = pkgs.writeScript "transmission-pre-start" ''
      #!${pkgs.runtimeShell}
      set -ex
      cp -f ${settingsFile} ${settingsDir}/settings.json
    '';
  in
  