about summary refs log tree commit diff stats
path: root/modules/by-name/gi/git-back/module.nix
blob: 96f491353818a5b99a756cb4014ff12e29a148ad (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
39
40
41
{
  config,
  lib,
  ...
}: let
  cfg = config.vhack.git-back;
in {
  options.vhack.git-back = {
    enable = lib.mkEnableOption "Back integration into git-server";

    domain = lib.mkOption {
      type = lib.types.str;
      description = "The domain where to deploy back";
    };
  };

  config = lib.mkIf cfg.enable {
    vhack.back = {
      enable = true;

      user = "git";
      group = "git";

      settings = {
        scan_path = "${config.services.gitolite.dataDir}/repositories";
        project_list = "${config.services.gitolite.dataDir}/projects.list";
        root_url = "https://${cfg.domain}";
      };
    };

    services.nginx = {
      enable = true;
      virtualHosts."${cfg.domain}" = {
        locations."/".proxyPass = "http://127.0.0.1:8000";

        enableACME = true;
        forceSSL = true;
      };
    };
  };
}