remove librechat, not from lio yet so I can recover the data

This commit is contained in:
RingOfStorms (Joshua Bell) 2025-08-22 00:40:47 -05:00
parent c91d9dc23c
commit a53d0510d1
6 changed files with 38 additions and 168 deletions

View file

@ -1,149 +0,0 @@
{
config,
pkgs,
...
}:
let
cfg = config.services.librechat;
in
{
options.services.librechat =
let
lib = pkgs.lib;
in
{
port = lib.mkOption {
type = lib.types.port;
default = 3080;
description = "Port number for the LibreChat";
};
ragPort = lib.mkOption {
type = lib.types.port;
default = 8000;
description = "Port number for the RAG API service";
};
dataDir = lib.mkOption {
type = lib.types.path;
default = "/var/lib/librechat";
description = "Directory to store LibreChat data";
};
};
config = {
systemd.services.create-librechat-network = {
description = "Create Docker network for LibreChat";
serviceConfig.Type = "oneshot";
wantedBy = [ "multi-user.target" ];
script = ''
if ! ${pkgs.docker}/bin/docker network inspect librechat-network >/dev/null 2>&1; then
${pkgs.docker}/bin/docker network create librechat-network
fi
'';
};
virtualisation.oci-containers.containers = {
#############
# librechat #
#############
# NOTE settings live in `/var/lib/librechat` manually right now
librechat = {
user = "root";
image = "ghcr.io/danny-avila/librechat-dev:latest";
ports = [
"${toString cfg.port}:${toString cfg.port}"
];
dependsOn = [
"librechat_mongodb"
"librechat_rag_api"
];
environment = {
HOST = "0.0.0.0";
MONGO_URI = "mongodb://librechat_mongodb:27017/LibreChat";
SEARCH = "true";
MEILI_HOST = "http://librechat_meilisearch:7700";
MEILI_NO_ANALYTICS = "true";
MEILI_MASTER_KEY = "ringofstormsLibreChat";
RAG_PORT = toString cfg.ragPort;
RAG_API_URL = "http://librechat_rag_api:${toString cfg.ragPort}";
};
environmentFiles = [ "${cfg.dataDir}/.env" ];
volumes = [
"${cfg.dataDir}/.env:/app/.env"
"${cfg.dataDir}/librechat.yaml:/app/librechat.yaml"
"${cfg.dataDir}/images:/app/client/public/images"
"${cfg.dataDir}/logs:/app/api/logs"
];
extraOptions = [
"--network=librechat-network"
"--add-host=azureproxy:100.64.0.8"
"--add-host=ollamaproxy:100.64.0.6"
];
};
librechat_mongodb = {
user = "root";
image = "mongo";
volumes = [
"${cfg.dataDir}/data-node:/data/db"
];
cmd = [
"mongod"
"--noauth"
];
extraOptions = [ "--network=librechat-network" ];
};
librechat_meilisearch = {
user = "root";
image = "getmeili/meilisearch:v1.12.3";
environment = {
MEILI_HOST = "http://librechat_meilisearch:7700";
MEILI_NO_ANALYTICS = "true";
MEILI_MASTER_KEY = "ringofstormsLibreChat";
};
volumes = [
"${cfg.dataDir}/meili_data_v1.12:/meili_data"
];
extraOptions = [ "--network=librechat-network" ];
};
librechat_vectordb = {
user = "root";
image = "ankane/pgvector:latest";
environment = {
POSTGRES_DB = "mydatabase";
POSTGRES_USER = "myuser";
POSTGRES_PASSWORD = "mypassword";
};
volumes = [
"${cfg.dataDir}/pgdata2:/var/lib/postgresql/data"
];
extraOptions = [ "--network=librechat-network" ];
};
librechat_rag_api = {
user = "root";
image = "ghcr.io/danny-avila/librechat-rag-api-dev-lite:latest";
environment = {
DB_HOST = "librechat_vectordb";
RAG_PORT = toString cfg.ragPort;
};
dependsOn = [ "librechat_vectordb" ];
environmentFiles = [ "${cfg.dataDir}/.env" ];
extraOptions = [ "--network=librechat-network" ];
};
# TODO revisit local whisper, for now I am using groq free for STT
# librechat_whisper = {
# user = "root";
# image = "onerahmet/openai-whisper-asr-webservice:latest";
# # ports = [ "8080:8080" ];
# environment = {
# ASR_MODEL = "base"; # You can change to small, medium, large, etc.
# ASR_ENGINE = "openai_whisper";
# };
# extraOptions = [ "--network=librechat-network" ];
# };
};
};
}

View file

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

View file

@ -7,7 +7,6 @@ in
}:
{
imports = [
# common.nixosModules.containers.librechat
common.nixosModules.containers.forgejo
./opengist.nix
./homarr.nix

View file

@ -4,8 +4,8 @@
nixpkgs-unstable.url = "github:nixos/nixpkgs/nixos-unstable";
# Use relative to get current version for testing
common.url = "path:../../common";
# common.url = "git+https://git.joshuabell.xyz/ringofstorms/dotfiles";
# common.url = "path:../../common";
common.url = "git+https://git.joshuabell.xyz/ringofstorms/dotfiles";
ros_neovim.url = "git+https://git.joshuabell.xyz/ringofstorms/nvim";

47
hosts/lio/flake.lock generated
View file

@ -29,17 +29,22 @@
"inputs": {
"home-manager": "home-manager",
"nix-flatpak": "nix-flatpak",
"nixpkgs": "nixpkgs_2",
"ragenix": "ragenix"
},
"locked": {
"path": "../../common",
"type": "path"
"lastModified": 1755840659,
"narHash": "sha256-h/qwTgidh4lPLj018fRllg1VtoRXVEpC+L6RFomWesw=",
"ref": "refs/heads/master",
"rev": "c91d9dc23c4abf3567b653f383578621a77be0ab",
"revCount": 614,
"type": "git",
"url": "https://git.joshuabell.xyz/ringofstorms/dotfiles"
},
"original": {
"path": "../../common",
"type": "path"
},
"parent": []
"type": "git",
"url": "https://git.joshuabell.xyz/ringofstorms/dotfiles"
}
},
"crane": {
"locked": {
@ -189,6 +194,22 @@
}
},
"nixpkgs_2": {
"locked": {
"lastModified": 1753694789,
"narHash": "sha256-cKgvtz6fKuK1Xr5LQW/zOUiAC0oSQoA9nOISB0pJZqM=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "dc9637876d0dcc8c9e5e22986b857632effeb727",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_3": {
"locked": {
"lastModified": 1741379970,
"narHash": "sha256-Wh7esNh7G24qYleLvgOSY/7HlDUzWaL/n4qzlBePpiw=",
@ -204,7 +225,7 @@
"type": "github"
}
},
"nixpkgs_3": {
"nixpkgs_4": {
"locked": {
"lastModified": 1755471983,
"narHash": "sha256-axUoWcm4cNQ36jOlnkD9D40LTfSQgk8ExfHSRm3rTtg=",
@ -220,7 +241,7 @@
"type": "github"
}
},
"nixpkgs_4": {
"nixpkgs_5": {
"locked": {
"lastModified": 1755648324,
"narHash": "sha256-+2TxwJEXWXGC7JBsRGUHtmQ66lRGPcDI2kFKTTU5e2s=",
@ -235,7 +256,7 @@
"type": "github"
}
},
"nixpkgs_5": {
"nixpkgs_6": {
"locked": {
"lastModified": 1755186698,
"narHash": "sha256-wNO3+Ks2jZJ4nTHMuks+cxAiVBGNuEBXsT29Bz6HASo=",
@ -1157,7 +1178,7 @@
"agenix": "agenix",
"crane": "crane",
"flake-utils": "flake-utils",
"nixpkgs": "nixpkgs_2",
"nixpkgs": "nixpkgs_3",
"rust-overlay": "rust-overlay"
},
"locked": {
@ -1177,7 +1198,7 @@
"root": {
"inputs": {
"common": "common",
"nixpkgs": "nixpkgs_3",
"nixpkgs": "nixpkgs_4",
"nixpkgs-unstable": "nixpkgs-unstable",
"ros_neovim": "ros_neovim",
"zaphkiel": "zaphkiel"
@ -1185,7 +1206,7 @@
},
"ros_neovim": {
"inputs": {
"nixpkgs": "nixpkgs_4",
"nixpkgs": "nixpkgs_5",
"nvim_plugin-Almo7aya/openingh.nvim": "nvim_plugin-Almo7aya/openingh.nvim",
"nvim_plugin-CopilotC-Nvim/CopilotChat.nvim": "nvim_plugin-CopilotC-Nvim/CopilotChat.nvim",
"nvim_plugin-JoosepAlviste/nvim-ts-context-commentstring": "nvim_plugin-JoosepAlviste/nvim-ts-context-commentstring",
@ -1347,7 +1368,7 @@
},
"zaphkiel": {
"inputs": {
"nixpkgs": "nixpkgs_5",
"nixpkgs": "nixpkgs_6",
"quickshell": "quickshell",
"systems": "systems_3"
},

View file

@ -4,8 +4,8 @@
nixpkgs-unstable.url = "github:nixos/nixpkgs/nixos-unstable";
# Use relative to get current version for testing
common.url = "path:../../common";
# common.url = "git+https://git.joshuabell.xyz/ringofstorms/dotfiles";
# common.url = "path:../../common";
common.url = "git+https://git.joshuabell.xyz/ringofstorms/dotfiles";
ros_neovim.url = "git+https://git.joshuabell.xyz/ringofstorms/nvim";