summaryrefslogtreecommitdiff
path: root/nixos/hosts/ev/ente.nix
blob: 2ffa18d0e4931fc4307455867efbe1b0aa78cdfc (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
26
27
28
29
30
31
32
33
34
35
36
37
38
{ config, lib, pkgs, ... }:

let
  cfg = config.ente;
in
{
  options.ente = {
    minioPort = lib.mkOption {
      type = lib.types.int;
    };

    minioDataDir = lib.mkOption {
      type = lib.types.str;
    };
  };

  config = {
    containers.ente-minio = {
      config = {
        services.minio = {
          enable = true;
          accessKey = "ente";
          secretKey = "...."; # TODO: pass in via config?
          dataDir = [cfg.minioDataDir];
          listenAddress = ":${toString cfg.minioPort}";
        };
      };
    };

    virtualisation.oci-containers.containers.ente = {
      image = "ghcr.io/ente-io/server";
      # TODO: specify the rest
    };

    # TODO: specify that ente oci container requires ente-minio
    # TODO: specify that ente oci container requires postgresql
  };
}