anchor.diff:  
   
           # link in all user specified plugins
  -        rm -rf "${cfg.stateDir}/plugins/"*
           for plugin in ${concatStringsSep " " (mapAttrsToList unpackPlugin cfg.plugins)}; do
             ln -fs $plugin/* "${cfg.stateDir}/plugins/''${plugin##*-redmine-plugin-}"
           done
  -
  -
  -        # ensure correct permissions for most files
  -        chmod -R ug+rwX,o-rwx+x "${cfg.stateDir}/"
   
   
           # handle database.passwordFile & permissions
  
positive.code: 
      environment.systemPackages = [ cfg.package ];
  
      systemd.services.redmine = {
        after = [ "network.target" (if cfg.database.type == "mysql2" then "mysql.service" else "postgresql.service") ];
        wantedBy = [ "multi-user.target" ];
        environment.HOME = "${cfg.package}/share/redmine";
        environment.RAILS_ENV = "production";
        environment.RAILS_CACHE = "${cfg.stateDir}/cache";
        environment.REDMINE_LANG = "en";
  
negative.code:         subversion
        ];
        preStart = ''
          rm -rf "${cfg.stateDir}/plugins/"*
          rm -rf "${cfg.stateDir}/public/themes/"*
  
          # start with a fresh config directory
          # the config directory is copied instead of linked as some mutable data is stored in there
          find "${cfg.stateDir}/config" ! -name "secret_token.rb" -type f -exec rm -f {} +
          cp -r ${cfg.package}/share/redmine/config.dist/* "${cfg.stateDir}/config/"
  
          chmod -R u+w "${cfg.stateDir}/config"
  
          # link in the application configuration
          ln -fs ${configurationYml} "${cfg.stateDir}/config/configuration.yml"
  