all repos

dotfiles @ 8617799a3b022e29e7fdc0006e95de7359d9bb6b

i use rach linux btw

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

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