32 lines
682 B
Nix
32 lines
682 B
Nix
{
|
|
pkgs,
|
|
config,
|
|
lib,
|
|
...
|
|
}:
|
|
let cfg = config.cos.trilium; in
|
|
{
|
|
options.cos.trilium = {
|
|
enable = lib.mkEnableOption "trilium-server";
|
|
hostname = lib.mkOption {
|
|
type = lib.types.str;
|
|
};
|
|
port = lib.mkOption {
|
|
type = lib.types.port;
|
|
};
|
|
dataDir = lib.mkOption {
|
|
type = lib.types.str;
|
|
};
|
|
};
|
|
|
|
config = lib.mkIf cfg.enable {
|
|
services.trilium-server = {
|
|
enable = true;
|
|
package = pkgs.trilium-next-server;
|
|
port = cfg.port;
|
|
dataDir = cfg.dataDir;
|
|
};
|
|
|
|
services.cloudflared.tunnels.mine.ingress.${cfg.hostname} = "http://${config.services.trilium-server.host}:${builtins.toString cfg.port}";
|
|
};
|
|
}
|