Compare commits

..

2 Commits

Author SHA1 Message Date
Patrick Neff db2412e9ec cleanup 2024-11-05 06:48:15 +01:00
Patrick Neff 5f17ad166f add httpie 2024-10-30 07:53:00 +01:00
21 changed files with 206 additions and 30 deletions

13
cachix.nix Normal file
View File

@ -0,0 +1,13 @@
# WARN: this file will get overwritten by $ cachix use <name>
{ pkgs, lib, ... }:
let
folder = ./cachix;
toImport = name: value: folder + ("/" + name);
filterCaches = key: value: value == "regular" && lib.hasSuffix ".nix" key;
imports = lib.mapAttrsToList toImport (lib.filterAttrs filterCaches (builtins.readDir folder));
in {
inherit imports;
nix.settings.substituters = ["https://cache.nixos.org/"];
}

View File

@ -0,0 +1,13 @@
{
nix = {
settings = {
substituters = [
"https://cuda-maintainers.cachix.org"
];
trusted-public-keys = [
"cuda-maintainers.cachix.org-1:0dq3bujKpuEPMCX6U4WylrUDZ9JyUG0VpVZa7CNfq5E="
];
};
};
}

View File

@ -398,11 +398,11 @@
]
},
"locked": {
"lastModified": 1728092656,
"narHash": "sha256-eMeCTJZ5xBeQ0f9Os7K8DThNVSo9gy4umZLDfF5q6OM=",
"lastModified": 1729104314,
"narHash": "sha256-pZRZsq5oCdJt3upZIU4aslS9XwFJ+/nVtALHIciX/BI=",
"owner": "cachix",
"repo": "git-hooks.nix",
"rev": "1211305a5b237771e13fcca0c51e60ad47326a9a",
"rev": "3c3e88f0f544d6bb54329832616af7eb971b6be6",
"type": "github"
},
"original": {
@ -521,11 +521,11 @@
]
},
"locked": {
"lastModified": 1728337164,
"narHash": "sha256-VdRTjJFyq4Q9U7Z/UoC2Q5jK8vSo6E86lHc2OanXtvc=",
"lastModified": 1729260213,
"narHash": "sha256-jAvHoU/1y/yCuXzr2fNF+q6uKmr8Jj2xgAisK4QB9to=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "038630363e7de57c36c417fd2f5d7c14773403e4",
"rev": "09a0c0c02953318bf94425738c7061ffdc4cba75",
"type": "github"
},
"original": {
@ -666,11 +666,11 @@
]
},
"locked": {
"lastModified": 1728385805,
"narHash": "sha256-mUd38b0vhB7yzgAjNOaFz7VY9xIVzlbn3P2wjGBcVV0=",
"lastModified": 1728901530,
"narHash": "sha256-I9Qd0LnAsEGHtKE9+uVR0iDFmsijWSy7GT0g3jihG4Q=",
"owner": "lnl7",
"repo": "nix-darwin",
"rev": "48b50b3b137be5cfb9f4d006835ce7c3fe558ccc",
"rev": "a60ac02f9466f85f092e576fd8364dfc4406b5a6",
"type": "github"
},
"original": {
@ -827,11 +827,11 @@
"treefmt-nix": "treefmt-nix"
},
"locked": {
"lastModified": 1728485062,
"narHash": "sha256-+2e9hAM2GVDF3gywdQI/OA7s4f0Z9rvFuiVxePI41QM=",
"lastModified": 1729438888,
"narHash": "sha256-TGTDOX2/5OIoSzlcRReVn4BbbfL6Ami/eassiPPGqNA=",
"owner": "nix-community",
"repo": "nixvim",
"rev": "61ec39764fbe1e4f21cf801ea7b9209d527c8135",
"rev": "47b563d4e1410bff6a9481b3dd8b01b1e5ed70d2",
"type": "github"
},
"original": {
@ -905,11 +905,11 @@
]
},
"locked": {
"lastModified": 1728423244,
"narHash": "sha256-+YwNsyIFj3dXyLVQd1ry4pCNmtOpbceKUrkNS8wp9Ho=",
"lastModified": 1728905062,
"narHash": "sha256-W/lClt0bRgFRO0WFtytX/LEILpPNq+FOjIfESpkeu5c=",
"owner": "NuschtOS",
"repo": "search",
"rev": "f276cc3b391493ba3a8b30170776860f9520b7fa",
"rev": "f82d3e1c1c9d1eaeb91878519e2d27b27c66ce84",
"type": "github"
},
"original": {
@ -1048,11 +1048,11 @@
]
},
"locked": {
"lastModified": 1727984844,
"narHash": "sha256-xpRqITAoD8rHlXQafYZOLvUXCF6cnZkPfoq67ThN0Hc=",
"lastModified": 1729242555,
"narHash": "sha256-6jWSWxv2crIXmYSEb3LEVsFkCkyVHNllk61X4uhqfCs=",
"owner": "numtide",
"repo": "treefmt-nix",
"rev": "4446c7a6fc0775df028c5a3f6727945ba8400e64",
"rev": "d986489c1c757f6921a48c1439f19bfb9b8ecab5",
"type": "github"
},
"original": {

View File

@ -15,6 +15,7 @@
./tldr
./borgmatic
./yazi
./httpie
];
home.packages = with pkgs; [

View File

@ -0,0 +1,3 @@
{pkgs, ...}: {
home.packages = with pkgs; [httpie];
}

View File

@ -1,9 +1,10 @@
{overlays, ...}: {
{ inputs, overlays, ... }: {
nixpkgs = {
config.allowUnfree = true;
inherit overlays;
};
nix = {
registry.nixpkgs.flake = inputs.nixpkgs;
optimise = {
automatic = true;
};

View File

@ -12,6 +12,7 @@
iotop
ncdu
wget
openssl
];
etc = {
"ncdu.conf".text = ''

View File

@ -1,6 +1,9 @@
{
imports = [
./nginx
./searx
./open-webui
./postgresql
#./binary-cache
];
}

View File

@ -0,0 +1,17 @@
{ config
, lib
, ...
}:
with lib;
mkIf config.services.open-webui.enable {
services.open-webui = {
host = "0.0.0.0";
port = 8080;
environment = {
USER_AGENT = "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:131.0) Gecko/20100101 Firefox/131.0";
};
};
networking.firewall.allowedTCPPorts = [ config.services.open-webui.port ];
}

View File

@ -0,0 +1,10 @@
{ config
, lib
, ...
}:
with lib;
mkIf config.services.postgresql.enable {
services.postgresql = {
};
#networking.firewall.allowedTCPPorts = [ config.services.searx.settings.server.port ];
}

View File

@ -0,0 +1,39 @@
{ config
, lib
, ...
}:
with lib;
mkIf config.services.searx.enable {
services.searx = {
settings = {
server = {
port = 8000;
bind_address = "0.0.0.0";
secret_key = "sow4ruu4phaij7aich3wohshaec0iShieyieM3Shooch0Quaileeyu5edienaifa";
limiter = false;
};
ui = {
use_static_hash = true;
};
enabled_plugins = [
"Hash plugin"
"Self Informations"
"Tracker URL remover"
"Ahmia blacklist"
];
search = {
safe_search = 0;
default_lang = "";
formats = [ "html" "json" ];
autocomplete = "duckduckgo";
};
};
limiterSettings = {
botdetection.ip_limit.link_token = false;
};
};
networking.firewall.allowedTCPPorts = [ config.services.searx.settings.server.port ];
}

View File

@ -1,14 +1,14 @@
let
group = "YankHightlight";
yankHighlightGroup = "YankHightlight";
in {
autoGroups = {
${group} = {
${yankHighlightGroup} = {
clear = true;
};
};
autoCmd = [
{
inherit group;
group = yankHighlightGroup;
event = "TextYankPost";
pattern = "*";
callback = {

View File

@ -0,0 +1,39 @@
{ lib, ... }: {
plugins.avante = {
enable = true;
settings = {
provider = "ollama";
vendors = {
ollama = {
endpoint = "http://10.0.20.10:11434/v1";
model = "gemma2:2b";
temperature = 0;
max_tokens = 4096;
local = true;
parse_curl_args = lib.nixvim.mkRaw ''
function(opts, code_opts)
return {
url = opts.endpoint .. "/chat/completions",
headers = {
["Accept"] = "application/json",
["Content-Type"] = "application/json",
},
body = {
model = opts.model,
messages = require("avante.providers").copilot.parse_message(code_opts), -- you can make your own message, but this is very advanced
max_tokens = 2048,
stream = true,
},
}
end
'';
parse_response_data = lib.nixvim.mkRaw ''
function(data_stream, event_state, opts)
require("avante.providers").openai.parse_response(data_stream, event_state, opts)
end
'';
};
};
};
};
}

View File

@ -1,5 +1,15 @@
{
plugins = {
cmp-ai = {
enable = false;
settings = {
provider = "Ollama";
provider_options = {
model = "codegemma:2b";
base_url = "http://10.0.20.10:11434/api/generate";
};
};
};
friendly-snippets = {
enable = true;
};
@ -73,7 +83,8 @@
{ name = "nvim_lsp"; }
{ name = "nvim_lsp_signature_help"; }
{ name = "nvim_lsp_document_symbol"; }
{ name = "codeium"; }
#{ name = "cmp_ai"; }
#{ name = "codeium"; }
{ name = "path"; }
{ name = "buffer"; }
{ name = "treesitter"; }

View File

@ -6,5 +6,5 @@
cfg = config.programs.nixvim.ai;
in
lib.mkIf cfg.enable {
plugins.codeium-nvim.enable = true;
plugins.codeium-nvim.enable = false;
}

View File

@ -18,6 +18,8 @@
./trouble.nix
./undotree.nix
./notify.nix
./avante.nix
./render-markdown.nix
];
plugins = {

View File

@ -93,6 +93,8 @@
"dapui_console"
"dap-repl"
"fugitive"
"Avante"
"AvanteInput"
];
};
};

View File

@ -40,7 +40,7 @@
};
filesystem = {
filtered_items = {
hide_by_name = [ "node_modules" "package-lock.json" "result" ];
hide_by_name = [ "node_modules" "package-lock.json" "result" "vendor" ];
hide_by_pattern = [ "*_templ.go" ];
always_show = [ ".gitignore" ];
always_show_by_pattern = [ ".env*" ];

View File

@ -0,0 +1,8 @@
{
plugins.render-markdown = {
enable = true;
settings = {
file_types = [ "markdown" "Avante" ];
};
};
}

View File

@ -12,8 +12,4 @@
programs = {
ghidra.enable = false;
};
home.packages = with pkgs; [
go
];
}

View File

@ -6,6 +6,7 @@
outputs.nixosModules.home-manager
outputs.nixosModules.base
outputs.nixosModules.wsl
outputs.nixosModules.server
];
wsl.enable = true;
@ -15,5 +16,21 @@
inherit (vars) hostName domain;
};
programs.nix-ld.enable = true;
services = {
postgresql.enable = true;
open-webui = {
enable = true;
host = "0.0.0.0";
environment = {
OLLAMA_API_BASE_URL = "http://10.0.20.10:11434";
};
};
searx = {
enable = true;
};
};
system.stateVersion = "23.11";
}