add obsidian sync test

This commit is contained in:
RingOfStorms (Joshua Bell) 2025-06-06 12:13:18 -05:00
parent 5e573d7f14
commit 9548cde7ec
2 changed files with 56 additions and 0 deletions

View file

@ -0,0 +1,55 @@
{
config,
pkgs,
...
}:
let
cfg = config.services.obsidian_sync;
in
{
options.services.obsidian_sync =
let
lib = pkgs.lib;
in
{
port = lib.mkOption {
type = lib.types.port;
default = 5984;
description = "Port number for Obsidian Sync CouchDB server";
};
dataDir = lib.mkOption {
type = lib.types.path;
default = "/var/lib/obsidian_sync";
description = "Directory to store Obsidian Sync data";
};
serverUrl = lib.mkOption {
type = lib.types.str;
description = "URL of the Obsidian Sync server";
};
};
config = {
virtualisation.oci-containers.containers = {
#############
# obsidian_sync #
#############
obsidian_sync = {
user = "root";
image = "ghcr.io/danny-avila/obsidian_sync-dev:latest";
ports = [
"${toString cfg.port}:${toString cfg.port}"
];
environment = {
SERVER_URL = cfg.serverUrl;
COUCHDB_USER = "adminu";
COUCHDB_PASSWORD = "Password123"; # TODO move to a secret and link to it via envFiles
COUCHDB_DATABASE = "obsidian_sync";
};
# environmentFiles = [ "${cfg.dataDir}/.env" ]; $ TODO see above todo
volumes = [
"${cfg.dataDir}/data:/opt/couchdb/data"
];
};
};
};
}

View file

@ -43,6 +43,7 @@
containers = {
librechat = import ./_containers/librechat.nix;
forgejo = import ./_containers/forgejo.nix;
obsidian_sync = import ./_containers/obsidian_sync.nix;
};
};
homeManagerModules = {