summaryrefslogtreecommitdiffstats
path: root/shared/2configs/shack-nix-cacher.nix
blob: 7519bb3ac67b7bc39ca27e76b51cf55d23075983 (plain)
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
{ pkgs, lib, ... }:

{
  krebs.nginx = {
    enable = lib.mkDefault true;
    servers = {
      apt-cacher-ng = {
        server-names = [ "acng.shack" ];
        locations = lib.singleton (lib.nameValuePair "/" ''
          proxy_set_header   Host $host;
          proxy_set_header   X-Real-IP          $remote_addr;
          proxy_set_header   X-Forwarded-For $proxy_add_x_forwarded_for;
          proxy_pass http://localhost:3142/;
        '');
      };
    };
  };

  krebs.apt-cacher-ng = {
    enable = true;
    port = 3142;
    bindAddress = "localhost";
    cacheExpiration = 30;
  };
}