current state of things

This commit is contained in:
atagen 2025-06-18 01:06:36 +10:00
parent 63fbd6d499
commit b8d157ab6f
85 changed files with 895 additions and 6014 deletions

View file

@ -1,64 +0,0 @@
{
lib,
config,
...
}:
let
port = 3021;
in
{
imports = [ ./ollama.nix ];
localWebApps = {
anything-llm = {
name = "Anything LLM";
genericName = "Chatbot";
icon = ../icons/anythingllm.png;
inherit port;
requires.containers = [
"anything-llm"
"ollama"
];
};
};
services.podman.containers.anything-llm =
let
str = builtins.toString;
username = config.mainUser;
in
{
image = "docker.io/mintplexlabs/anythingllm";
devices = [ "nvidia.com/gpu=all" ];
ports = [ "${str port}:3001" ];
autoStart = false;
autoUpdate = "registry";
network = [ "ollama" ];
volumes =
let
home = "/home/${username}";
share = "${home}/.local/share/anything-llm";
in
[
"${share}:/app/server/storage"
"${share}/.env:/app/server/.env"
"${share}/config:/home/anythingllm/.config/anythingllm-desktop"
"${share}/config:/home/${username}/.config/anythingllm-desktop"
];
environment = {
STORAGE_DIR = "/app/server/storage";
LLM_PROVIDER = "ollama";
OLLAMA_BASE_PATH = "http://ollama:11434";
EMBEDDING_ENGINE = "ollama";
EMBEDDING_BASE_PATH = "http://ollama:11434";
VECTOR_DB = "lancedb";
WHISPER_PROVIDER = "local";
TTS_PROVIDER = "native";
};
extraConfig.Unit.Requires = [ "podman-ollama.service" ];
extraPodmanArgs = [
"--health-cmd"
(lib.escapeShellArg "bash -c 'cat < /dev/null > /dev/tcp/localhost/3001'")
];
};
}

View file

@ -1,14 +0,0 @@
_: {
programs.atuin = {
enable = true;
enableZshIntegration = true;
settings = {
inline_height = 20;
show_preview = true;
show_help = false;
enter_accept = false;
keymap_mode = "vim-normal";
style = "compact";
};
};
}

View file

@ -1,347 +0,0 @@
{
config,
lib,
pkgs,
...
}:
let
palette-hex = pkgs.lib.nix-rice.palette.toRgbHex pkgs.rice.palette;
in
{
programs.helix = {
enable = true;
themes = with palette-hex; {
nix-rice = {
"attribute" = bright.cyan;
"keyword" = {
fg = normal.red;
};
"keyword.directive" = normal.red;
"namespace" = bright.cyan;
"punctuation" = bright.yellow;
"punctuation.delimiter" = bright.yellow;
"operator" = bright.magenta;
"special" = normal.magenta;
"variable.other.member" = bright.blue;
"variable" = util.fg;
"variable.builtin" = bright.yellow;
"variable.parameter" = bright.white;
"type" = normal.yellow;
"type.builtin" = normal.yellow;
"constructor" = {
fg = bright.magenta;
modifiers = [ "bold" ];
};
"function" = {
fg = normal.green;
modifiers = [ "bold" ];
};
"function.macro" = bright.cyan;
"function.builtin" = normal.yellow;
"tag" = normal.red;
"comment" = {
fg = normal.magenta;
modifiers = [ "italic" ];
};
"constant" = {
fg = bright.magenta;
};
"constant.builtin" = {
fg = bright.magenta;
modifiers = [ "bold" ];
};
"string" = normal.green;
"constant.numeric" = bright.magenta;
"constant.character.escape" = {
fg = bright.white;
modifiers = [ "bold" ];
};
"label" = bright.cyan;
"module" = bright.cyan;
"diff.plus" = bright.green;
"diff.delta" = bright.yellow;
"diff.minus" = bright.red;
"warning" = bright.yellow;
"error" = bright.red;
"info" = bright.cyan;
"hint" = bright.blue;
"ui.background" = {
inherit (util) bg;
};
"ui.linenr" = {
fg = normal.cyan;
};
"ui.linenr.selected" = {
fg = normal.yellow;
modifiers = [ "bold" ];
};
"ui.cursorline" = {
bg = normal.black;
};
"ui.statusline" = {
inherit (util) fg;
bg = bright.black;
};
"ui.statusline.normal" = {
inherit (util) fg;
bg = bright.black;
};
"ui.statusline.insert" = {
inherit (util) fg;
bg = normal.blue;
};
"ui.statusline.select" = {
inherit (util) fg;
bg = bright.yellow;
};
"ui.statusline.inactive" = {
fg = normal.white;
bg = normal.black;
};
"ui.popup" = {
bg = normal.black;
};
"ui.window" = {
bg = normal.black;
};
"ui.help" = {
bg = normal.black;
inherit (util) fg;
};
"ui.text" = {
inherit (util) fg;
};
"ui.text.focus" = {
inherit (util) fg;
};
"ui.selection" = {
# modifiers = ["reversed"];
bg = bright.yellow;
};
"ui.selection.primary" = {
modifiers = [ "reversed" ];
};
# "ui.selection.primary" = { bg = bright.cyan; };
"ui.cursor.primary" = {
bg = normal.white;
fg = normal.black;
};
"ui.cursor.match" = {
bg = bright.cyan;
};
"ui.menu" = {
inherit (util) fg;
bg = bright.black;
};
"ui.menu.selected" = {
fg = bright.black;
bg = bright.blue;
modifiers = [ "bold" ];
};
"ui.virtual.whitespace" = bright.black;
"ui.virtual.ruler" = {
bg = normal.black;
};
"ui.virtual.inlay-hint" = {
fg = normal.magenta;
};
"diagnostic.warning" = {
underline = {
color = bright.yellow;
style = "curl";
};
};
"diagnostic.error" = {
underline = {
color = bright.red;
style = "curl";
};
};
"diagnostic.info" = {
underline = {
color = bright.cyan;
style = "curl";
};
};
"diagnostic.hint" = {
underline = {
color = bright.blue;
style = "curl";
};
};
"markup.heading" = bright.cyan;
"markup.bold" = {
modifiers = [ "bold" ];
};
"markup.italic" = {
modifiers = [ "italic" ];
};
"markup.strikethrough" = {
modifiers = [ "crossed_out" ];
};
"markup.link.url" = {
fg = bright.green;
modifiers = [ "underlined" ];
};
"markup.link.text" = bright.red;
"markup.raw" = bright.red;
};
};
# theme = "nix-rice"
# [editor]
# bufferline = "multiple"
# cursorline = true
# true-color = true
# [editor.cursor-shape]
# insert = "bar"
# normal = "block"
# select = "underline"
# [editor.lsp]
# display-messages = true
# [editor.statusline]
# left = ["mode", "spinner", "version-control", "file-name", "file-modification-indicator"]
settings = {
theme = "nix-rice";
editor = {
bufferline = "multiple";
cursorline = true;
true-color = true;
cursor-shape = {
insert = "bar";
normal = "block";
select = "underline";
};
statusline.left = [
"mode"
"spinner"
"version-control"
"file-name"
"file-modification-indicator"
];
lsp.display-messages = true;
keys =
let
extend = {
"A-x" = "extend_to_line_bounds";
"X" = [
"extend_line_up"
"extend_to_line_bounds"
];
};
in
{
normal = extend;
select = extend;
};
};
};
languages = {
language = [
{
name = "rust";
language-servers = [
"rust-analyzer"
"lsp-ai"
];
auto-format = true;
}
{
name = "nix";
language-servers = [
"nixd"
"lsp-ai"
];
file-types = [ "nix" ];
# auto-format = true;
formatter = {
command = "alejandra";
};
}
{
name = "ocaml";
language-servers = [
"ocamllsp"
"lsp-ai"
];
file-types = [
"ml"
"mli"
];
auto-format = true;
formatter = {
command = "ocamlformat";
};
}
];
language-server = {
nixd = {
command = "nixd";
};
lsp-ai = {
command = "lsp-ai";
config = {
memory.fileStore = { };
models = {
llama32 = {
type = "ollama";
model = "llama3.2";
};
starcoder2 = {
type = "ollama";
model = "starcoder2:7b";
};
};
completion = {
model = "starcoder2";
parameters = {
maxContext = 1024;
options = {
numPredict = 32;
};
postProcess = {
removeDuplicateStart = true;
removeDuplicateEnd = true;
};
};
};
chat = {
trigger = "!C";
action_display_name = "Chat";
model = "llama32";
parameters = {
max_context = 4096;
max_tokens = 1024;
system = "You are a code assistant chatbot. The user will ask you for assistance coding and you will do your best to answer succinctly and accurately.";
};
};
};
};
rust-analyzer = {
config = {
cargo = {
buildScripts = {
enable = true;
};
};
procMacro = {
enable = true;
};
check = {
command = "clippy";
};
};
};
}; # language-server
}; # languages
}; # helix config
}

View file

@ -1,15 +1,17 @@
{
nix-rice,
inputs,
pkgs,
rice,
...
}:
let
palette-hex = nix-rice.palette.toRgbHex rice.palette;
pal = rice.palette.hex;
in
{
programs.helix = {
enable = true;
themes = with palette-hex; {
package = inputs.helix.packages.${pkgs.system}.helix;
themes = with pal; {
nix-rice = {
"attribute" = bright.cyan;
"keyword" = {
@ -208,15 +210,6 @@ in
"file-modification-indicator"
];
lsp.display-messages = true;
# keys = let
# extend = {
# "A-x" = "extend_to_line_bounds";
# "X" = ["extend_line_up" "extend_to_line_bounds"];
# };
# in {
# normal = extend;
# select = extend;
# };
};
};
@ -238,23 +231,20 @@ in
];
language-server = {
qmlls = {
command = "qmlls";
args = [ "-E" ];
};
nil = {
command = "nil";
};
rust-analyzer = {
config = {
cargo = {
buildScripts = {
enable = true;
};
};
procMacro = {
enable = true;
};
check = {
command = "clippy";
};
cargo.buildScripts.enable = true;
procMacro.enable = true;
check.command = "clippy";
};
};
}; # language-server

View file

@ -1,10 +1,9 @@
{
nix-rice,
rice,
...
}:
let
palette-hex = nix-rice.palette.toRgbHex rice.palette;
pal = rice.palette.hex;
in
{
programs.kitty = {
@ -12,7 +11,7 @@ in
font = {
inherit (rice.fonts.monospace) name size;
};
settings = with palette-hex; {
settings = with pal; {
foreground = util.fg;
background = util.bg;
inherit (util) cursor;
@ -37,6 +36,7 @@ in
color15 = bright.white;
sync_to_monitor = "yes";
shell = "fish";
cursor_trail = 100;
};
};
}

View file

@ -1,82 +0,0 @@
{
pkgs,
lib,
config,
...
}:
{
xdg.desktopEntries.ollama = {
name = "Ollama";
type = "Application";
icon = ../icons/ollama.png;
exec =
let
inherit (lib) getExe getExe';
notify-send = "${getExe' pkgs.libnotify "notify-send"} -a \"Ollama\"";
systemctl = "${getExe' pkgs.systemd "systemctl"}";
podman = "${getExe pkgs.podman}";
in
"${pkgs.writeShellScript "ollama" ''
set -euo pipefail
exit_error() {
${notify-send} -w "Failure" $1
exit 1
}
container_checks() {
if [ "$(${podman} inspect -f {{.State.Health.Status}} ollama)" == "healthy" ]; then
return 0
else
return 1
fi
}
${notify-send} "Launching Ollama.." "Please be patient."
${systemctl} --user start podman-ollama
checks=0
until container_checks; do
sleep 2
checks=$((checks+1))
if [ $((checks%10)) -eq 0 ]; then
${notify-send} "Launching.."
fi
if [ $checks -ge 60 ]; then
${systemctl} --no-block --user stop podman-ollama.target
exit_error "Failed to launch!"
fi
done
${notify-send} "Ollama serving on port 11434."
''}";
};
services.podman = {
containers.ollama =
let
username = config.mainUser;
in
{
image = "docker.io/ollama/ollama:latest";
devices = [ "nvidia.com/gpu=all" ];
autoStart = false;
autoUpdate = "registry";
network = [ "ollama" ];
ports = [ "11434:11434" ];
volumes = [
"/home/${username}/.local/share/ollama:/models"
];
environment.OLLAMA_MODELS = "/models";
extraPodmanArgs = [
"--health-cmd"
(lib.escapeShellArg "bash -c 'cat < /dev/null > /dev/tcp/localhost/11434'")
];
};
networks.ollama = {
subnet = "192.168.10.0/24";
gateway = "192.168.10.1";
};
};
}

View file

@ -1,48 +0,0 @@
{
lib,
...
}:
let
port = 3021;
in
{
imports = [ ./ollama.nix ];
localWebApps = {
openwebui = {
name = "OpenWebUI";
genericName = "LLM";
icon = ../icons/openwebui.png;
inherit port;
requires.containers = [
"openwebui"
"ollama"
];
};
};
services.podman = {
containers.openwebui =
let
str = builtins.toString;
in
{
# serviceName = "openwebui";
image = "ghcr.io/open-webui/open-webui:main";
ports = [ "${str port}:${str port}" ];
environment = {
WEBUI_AUTH = "False";
PORT = "${str port}";
};
autoStart = false;
networks = [ "ollama" ];
unitConfig = {
Requires = [ "podman-ollama.service" ];
};
extraOptions = [
"--health-cmd"
(lib.escapeShellArg "bash -c 'cat < /dev/null > /dev/tcp/localhost/${str port}'")
];
};
};
}

View file

@ -1,17 +0,0 @@
{
lib,
config,
...
}:
{
localWebApps = {
stable-diffusion = {
name = "Stable Diffusion";
genericName = "Image Generator";
icon = ../icons/comfyui.png;
id = 5;
port = 7860;
requires = [ "stable-diffusion" ];
};
};
}

View file

@ -1,39 +0,0 @@
{ rice, inputs, ... }:
{
programs.vscode = {
enable = true;
mutableExtensionsDir = false;
profiles.default = {
extensions = with inputs.nix-vscode.extensions.x86_64-linux.vscode-marketplace; [
rust-lang.rust-analyzer
ocamllabs.ocaml-platform
jnoortheen.nix-ide
mkhl.direnv
barbosshack.crates-io
vadimcn.vscode-lldb
kend.dancehelixkey
hikionori.kanagawa-vscode-theme
dbaeumer.vscode-eslint
ms-vscode.extension-test-runner
];
userSettings = {
"window.titleBarStyle" = "custom";
"editor.fontFamily" = "${rice.fonts.monospace.name}";
"editor.fontSize" = 12;
"editor.formatOnSave" = true;
"workbench.colorTheme" = "KanagawaTheme";
"rust-analyzer.debug.engine" = "vadimcn.vscode-lldb";
"rust-analyzer.inlayHints.chainingHints.enable" = false;
"rust-analyzer.inlayHints.parameterHints.enable" = false;
"rust-analyzer.inlayHints.typeHints.enable" = false;
"nix.enableLanguageServer" = true;
"nix.serverPath" = "nil";
"nix.serverSettings" = {
nil.formatting.command = [
"nixfmt"
];
};
};
};
};
}

View file

@ -1,11 +1,10 @@
{
nix-rice,
rice,
pkgs,
...
}:
let
palette-hex = nix-rice.palette.toRgbHex rice.palette;
pal = rice.palette.hex;
in
{
programs.wlogout = {
@ -13,7 +12,7 @@ in
package = pkgs.wleave;
layout = builtins.fromJSON (builtins.readFile ../dots/wlogout/layout);
style =
with palette-hex;
with pal;
(builtins.replaceStrings
[
"/usr/share/wlogout"

View file

@ -1,43 +0,0 @@
{
pkgs,
lib,
config,
inputs,
...
}:
let
inherit (lib) getExe;
inherit (config.home) homeDirectory;
palette-hex = inputs.nix-rice.palette.toRgbHex pkgs.rice.palette;
in
{
ezOneShots = with pkgs; {
xrdb = "${getExe xorg.xrdb} -load ${homeDirectory}/.Xresources";
};
home.packages = with pkgs; [
xorg.xrdb
];
xresources.properties = with palette-hex; {
"*.foreground" = util.fg;
"*.background" = util.bg;
"*.cursorColor" = util.cursor;
"*.selection_foreground" = util.fg_sel;
"*.selection_background" = util.bg_sel;
"*.color0" = normal.black;
"*.color1" = normal.red;
"*.color2" = normal.green;
"*.color3" = normal.yellow;
"*.color4" = normal.blue;
"*.color5" = normal.magenta;
"*.color6" = normal.cyan;
"*.color7" = normal.white;
"*.color8" = bright.black;
"*.color9" = bright.red;
"*.color10" = bright.green;
"*.color11" = bright.yellow;
"*.color12" = bright.blue;
"*.color13" = bright.magenta;
"*.color14" = bright.cyan;
"*.color15" = bright.white;
};
}

View file

@ -1,69 +0,0 @@
{
lib,
pkgs,
...
}:
{
programs.zsh = {
enable = true;
autosuggestion.enable = true;
enableCompletion = true;
syntaxHighlighting.enable = true;
enableVteIntegration = true;
autocd = true;
defaultKeymap = "viins";
initExtra = builtins.readFile ../dots/zsh;
plugins = [
{
name = "powerlevel10k";
src = pkgs.zsh-powerlevel10k;
file = "share/zsh-powerlevel10k/powerlevel10k.zsh-theme";
}
{
name = "zsh-vi-mode";
src = pkgs.zsh-vi-mode;
file = "share/zsh-vi-mode/zsh-vi-mode.zsh";
}
{
name = "zsh-autopair";
src = pkgs.zsh-autopair;
file = "share/zsh-autopair/zsh-autopair.zsh";
}
{
name = "zsh-completions";
src = pkgs.zsh-completions;
file = "share/zsh-completions/zsh-completions.zsh";
}
{
name = "zsh-command-time";
src = pkgs.zsh-command-time;
file = "share/zsh-completions/zsh-command-time.zsh";
}
{
name = "zsh-autocomplete";
src = pkgs.zsh-autocomplete;
file = "share/zsh-autocomplete/zsh-autocomplete.zsh";
}
{
name = "zsh-fast-syntax-highlighting";
src = pkgs.zsh-fast-syntax-highlighting;
file = "share/zsh-fast-syntax-highlighting/zsh-fast-syntax-highlighting.zsh";
}
{
name = "zsh-nix-shell";
src = pkgs.zsh-nix-shell;
file = "share/zsh-nix-shell/zsh-nix-shell.zsh";
}
{
name = "any-nix-shell";
src = pkgs.any-nix-shell;
file = "share/any-nix-shell/any-nix-shell.zsh";
}
{
name = "nix-zsh-completions";
src = pkgs.nix-zsh-completions;
file = "share/nix-zsh-completions/nix-zsh-completions.zsh";
}
];
};
}