aboutsummaryrefslogtreecommitdiff
path: root/modules/network/default.nix
blob: 25cd5aa4af352b5efdac3d5bc2290e6d4b78789b (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
42
43
44
45
46
47
48
49
{ settings, ... }:
let
  ports = settings.network.ports;
  host = settings.network.host;
in
{
  imports = [
    ./wireless.nix
    ./ssh.nix
    ../../services/service-router.service.nix
    ../../services/bacchus-dns.service.nix
  ];

  networking = {
    hostName = "bacchus";
    firewall.enable = true;
  };

  # Service mappings (dns + nginx)
  services.service-router = {
    enable = true;
    routes = {
      "home.local" = { inherit host; port = ports.dashboard; };
      "sonarr.local" = { inherit host; port = ports.sonarr; };
      "radarr.local" = { inherit host; port = ports.radarr; };
      "prowlarr.local" = { inherit host; port = ports.prowlarr; };
      "jellyfin.local" = { inherit host; port = ports.jellyfin; };
      "jellyseerr.local" = { inherit host; port = ports.jellyseerr; };
      "syncthing.local" = { inherit host; port = ports.syncthing; };
      # "lidarr.local" = { inherit host; port = ports.lidarr; };
      "ntfy.local" = { inherit host; port = ports.ntfy; };
      "grafana.local" = { inherit host; port = ports.grafana; extraNginxOptions.recommendedProxySettings = true; };
      "send.local" = { inherit host; port = ports.send; };
      "photos.local" = { inherit host; port = ports.immich; };
      "news.local" = { inherit host; port = ports.yarr; };
      # "librarian.local" = { inherit host; port = ports.lazylibrarian; };
      "paperless.local" = { inherit host; port = ports.paperless; configureNginx = true; };
      "calendar.local" = { inherit host; port = ports.caldav; };
    };
  };

  # Host mappings defined by service-router
  services.bacchus-dns = {
    enable = true;
    port = 53;
    openFirewall = true;
    fallback = [ "1.1.1.1" "8.8.8.8" ];
  };
}