aboutsummaryrefslogtreecommitdiff
path: root/nixops/modules/websites/tools/dav/infcloud.nix
blob: 876578b3f405403ef8422b01ab38484507eeb144 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
{ stdenv, fetchzip, ed }:
let
  infcloud = rec {
    webRoot = stdenv.mkDerivation rec {
      version = "0.13.1";
      name = "InfCloud-${version}";
      src = fetchzip {
        url = "https://www.inf-it.com/InfCloud_${version}.zip";
        sha256 = "1fjhs0cj0b9fhf5ysfz281mknmmg1z551bas143sxfcqlpa5aiiq";
      };
      buildPhase = ''
        ./cache_update.sh
        rm config.js
      '';
      installPhase = ''
        cp -a . $out
        ln -s ${./infcloud_config.js} $out/config.js
      '';
      buildInputs = [ ed ];
    };
    apache = {
      user = "wwwrun";
      group = "wwwrun";
      vhostConf = ''
        Alias /carddavmate ${webRoot}
        Alias /caldavzap ${webRoot}
        Alias /infcloud ${webRoot}
        <Directory ${webRoot}>
          AllowOverride All
          Options FollowSymlinks
          Require all granted
          DirectoryIndex index.html
        </Directory>
        '';
    };
  };
in
  infcloud