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 | networking.firewall.allowedTCPPorts = [ 22 ]; |
| 8 | services.caddy.virtualHosts."git.olexsmir.xyz".extraConfig = '' |
| 9 | reverse_proxy localhost:8008 |
| 10 | ''; |
| 11 | |
| 12 | services.mugit = { |
| 13 | enable = true; |
| 14 | exposeCli = 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 | } |