all repos

dotfiles @ 9068778bc81c6d1955fb3b4cae56d33de7dcb360

i use rach linux btw

dotfiles/nix/modules/mugit.nix (view raw)

1
{ config, ... }:
2
{
3
  services.caddy.virtualHosts."git.olexsmir.xyz".extraConfig = ''
4
    reverse_proxy localhost:8008
5
  '';
6
7
  age.secrets.github_token = {
8
    file = ../secrets/github_token.age;
9
    owner = "mugit";
10
    group = "mugit";
11
  };
12
13
  age.secrets.mugit_host = {
14
    file = ../secrets/mugit_host.age;
15
    owner = "mugit";
16
    group = "mugit";
17
  };
18
19
  services.mugit = {
20
    enable = true;
21
    exposeCli = true;
22
    openFirewall = true;
23
    config = {
24
      server.port = 8008;
25
      repo.dir = "/var/lib/mugit/";
26
      meta = {
27
        description = "hey kid, come get your free software";
28
        title = "git.olexsmir.xyz";
29
        host = "git.olexsmir.xyz";
30
      };
31
      ssh = {
32
        enable = true;
33
        port = 22;
34
        host_key = config.age.secrets.mugit_host.path;
35
        keys = [
36
          "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPLLJdkVYKZgsayw+sHanKPKZbI0RMS2CakqBCEi5Trz"
37
          "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIMPQ0Qz0DFB+rGrD8ScUqbUTZ1/O8FHrOBF5bIAGQgMj"
38
        ];
39
      };
40
      mirror = {
41
        enable = true;
42
        interval = "6h";
43
        github_token = "$file:" + config.age.secrets.github_token.path;
44
      };
45
    };
46
  };
47
}