WIP: redmine

almost embarrasing how ruby on rails handles deployment. i hope we never have to package any rails 

this pull request also requires changes from [3491](https://github.com/NixOS/nixpkgs/pull/3491) we first need to merge that one.

todo:

 - [x] make it possible configure sending email
 - [ ] configuration on which host and port to run redmine
 - [x] package it properly using debian patches
 - [x] add metadata (license, homepage, ...)
 - [x] add documentation how to create Gemfile.lock and Gemfile.nix

example configuration:

      services.redmine = {
        enable = true;
        databasePassword = "12345";
        themes = {
          circle = pkgs.fetchurl {
            url = "http://www.redminecrm.com/license_manager/11619/circle_theme-1_0_2.zip";
            md5 = "2cfc2e534dc57e8ce9475103ce087618";
          };
        };
        plugins = {
          redmine_custom_css = pkgs.fetchurl {
            url = "https://github.com/martin-denizet/redmine_custom_css/archive/0.1.4.tar.gz";
            md5 = "d1a9defe8d9d1732b98318c189570de6";
          };
          redmine_improved_searchbox = pkgs.fetchurl {
            url = "https://github.com/ries-tech/redmine_improved_searchbox/archive/0.0.3.tar.gz";
            md5 = "33957306af9fbd28fe3dbf83780d53f5";
          };
          sidebar_hide = pkgs.fetchurl {
            url = "https://github.com/bdemirkir/sidebar_hide/archive/0.0.7.tar.gz";
            md5 = "84e1a2ef39122b8f33fa1f6ba75bb4a0";
          };
          clipboard_image_paste = pkgs.fetchurl {
            url = "https://github.com/peclik/clipboard_image_paste/archive/v1.8.tar.gz";
            md5 = "703cd7c0d69e7024281194c28e75d65c";
          };
        };
      };
      services.nginx.enable = true;
      services.nginx.httpConfig = ''
        server {
          server_name  example.com;
          root  /var/redmine;
  
          location / {
            try_files $uri @redmine;
          }
  
          location @redmine {
            proxy_set_header  X-Real-IP  $remote_addr;
            proxy_set_header  X-Forwarded-For $proxy_add_x_forwarded_for;
            proxy_set_header  Host $http_host;
            proxy_redirect  off;
            proxy_read_timeout  300;
            proxy_pass  http://127.0.0.1:3000;
          }
        }
        '';