Compare commits

...

5 Commits

Author SHA1 Message Date
ce86eafd38 coders 2025-12-14 12:24:53 +01:00
6cb75f5957 treefmt 2025-12-09 23:07:55 +01:00
ef13eb8858 fix: allow broken packages in docling module
Co-authored-by: aider (openrouter/google/gemini-3-pro-preview) <aider@aider.chat>
2025-12-08 16:55:51 +01:00
5d9674da2f fix: bind docling-serve to localhost 2025-12-08 16:55:43 +01:00
c76199e73c added basic docling 2025-12-08 16:44:12 +01:00
10 changed files with 276 additions and 63 deletions

36
home/aider.nix Normal file
View File

@@ -0,0 +1,36 @@
{
pkgs,
lib,
unstable,
config,
...
}:
{
home.packages = with pkgs; [
aider-chat-full
];
programs.aider-chat = {
enable = true;
package = aider-chat-full;
settings = {
architect = true;
auto-accept-architect = false;
cache-prompts = true;
check-model-accepts-settings = false;
dark-mode = true;
dirty-commits = false;
lint = true;
show-model-warnings = false;
verify-ssl = false;
watch-files=true;
analytics-disable=true;
check-update=false;
multiline=true;
notifications=true;
show-diffs=true
};
};
}

View File

@@ -35,22 +35,22 @@
# base0F = "70d0c0"; # Deprecated tags - light teal
## catppuccin mocha based
base00 = "0b1c1a"; # Default background — deeper teal-dark background
base01 = "153532"; # Lighter background / status bars
base02 = "1b3d39"; # Selection background / line highlight
base03 = "275454"; # Comments, secondary UI elements
base04 = "6f7389"; # Dark foreground / secondary text
base05 = "95a0b8"; # Default foreground / main text
base06 = "a8b2ce"; # Light foreground / lighter UI elements
base07 = "ccdffa"; # Lightest background / highlight background
base08 = "f38ba8"; # Errors, alerts — red-pink accent
base09 = "e0a878"; # Numbers, constants — muted peach/orange
base0A = "b8c071"; # Warnings, highlights — golden-yellow
base0B = "4fbf93"; # Strings, inserts — teal-green
base0C = "2ac5c2"; # Support, escape/sequences — cyan-teal
base0D = "2fa6b0"; # Functions, types — classic teal-blue
base0E = "c7a8f5"; # Keywords, special — soft magenta/purple
base0F = "b2b4cf"; # Deprecated / special tags — light cool grey-lavender
base00 = "0b1c1a"; # Default background — deeper teal-dark background
base01 = "153532"; # Lighter background / status bars
base02 = "1b3d39"; # Selection background / line highlight
base03 = "275454"; # Comments, secondary UI elements
base04 = "6f7389"; # Dark foreground / secondary text
base05 = "95a0b8"; # Default foreground / main text
base06 = "a8b2ce"; # Light foreground / lighter UI elements
base07 = "ccdffa"; # Lightest background / highlight background
base08 = "f38ba8"; # Errors, alerts — red-pink accent
base09 = "e0a878"; # Numbers, constants — muted peach/orange
base0A = "b8c071"; # Warnings, highlights — golden-yellow
base0B = "4fbf93"; # Strings, inserts — teal-green
base0C = "2ac5c2"; # Support, escape/sequences — cyan-teal
base0D = "2fa6b0"; # Functions, types — classic teal-blue
base0E = "c7a8f5"; # Keywords, special — soft magenta/purple
base0F = "b2b4cf"; # Deprecated / special tags — light cool grey-lavender
};
};
}

View File

@@ -20,29 +20,29 @@
};
#colors = {
#alpha = "0.7";
#foreground = "${config.colorScheme.palette.base05}";
#background = "${config.colorScheme.palette.base00}";
#alpha = "0.7";
#foreground = "${config.colorScheme.palette.base05}";
#background = "${config.colorScheme.palette.base00}";
#regular0 = "${config.colorScheme.palette.base00}";
#regular1 = "${config.colorScheme.palette.base08}";
#regular2 = "${config.colorScheme.palette.base0B}";
#regular3 = "${config.colorScheme.palette.base0A}";
#regular4 = "${config.colorScheme.palette.base0D}";
#regular5 = "${config.colorScheme.palette.base0E}";
#regular6 = "${config.colorScheme.palette.base0C}";
#regular7 = "${config.colorScheme.palette.base05}";
#regular0 = "${config.colorScheme.palette.base00}";
#regular1 = "${config.colorScheme.palette.base08}";
#regular2 = "${config.colorScheme.palette.base0B}";
#regular3 = "${config.colorScheme.palette.base0A}";
#regular4 = "${config.colorScheme.palette.base0D}";
#regular5 = "${config.colorScheme.palette.base0E}";
#regular6 = "${config.colorScheme.palette.base0C}";
#regular7 = "${config.colorScheme.palette.base05}";
#bright0 = "${config.colorScheme.palette.base03}";
#bright1 = "${config.colorScheme.palette.base08}";
#bright2 = "${config.colorScheme.palette.base0B}";
#bright3 = "${config.colorScheme.palette.base0A}";
#bright4 = "${config.colorScheme.palette.base0D}";
#bright5 = "${config.colorScheme.palette.base0E}";
#bright6 = "${config.colorScheme.palette.base0C}";
#bright7 = "${config.colorScheme.palette.base07}";
#selection-foreground = "${config.colorScheme.palette.base00}";
#selection-background = "${config.colorScheme.palette.base0A}";
#bright0 = "${config.colorScheme.palette.base03}";
#bright1 = "${config.colorScheme.palette.base08}";
#bright2 = "${config.colorScheme.palette.base0B}";
#bright3 = "${config.colorScheme.palette.base0A}";
#bright4 = "${config.colorScheme.palette.base0D}";
#bright5 = "${config.colorScheme.palette.base0E}";
#bright6 = "${config.colorScheme.palette.base0C}";
#bright7 = "${config.colorScheme.palette.base07}";
#selection-foreground = "${config.colorScheme.palette.base00}";
#selection-background = "${config.colorScheme.palette.base0A}";
#};
};

View File

@@ -32,6 +32,8 @@
./mako.nix
./foot.nix
./zed.nix
./aider.nix
./opencode.nix
./neovim.nix
./fcitx5.nix

View File

@@ -5,7 +5,7 @@
viAlias = true;
vimAlias = true;
defaultEditor = true;
# Required for render-markdown and coc
withPython3 = true;
withNodeJs = true;
@@ -32,20 +32,20 @@
vim-lastplace
vim-nix
vim-yaml
# --- Coding / LSP (CoC) ---
# Keeping CoC as requested (switching to Native LSP is a bigger task)
coc-nvim
coc-vimtex
coc-rust-analyzer
# --- Markdown / LaTeX / Typst ---
vimtex
typst-vim
typst-preview-nvim
render-markdown-nvim
markdown-preview-nvim
# --- AI ---
aider-nvim
@@ -75,7 +75,7 @@
vim.opt.expandtab = true
vim.opt.smarttab = true
vim.opt.autoindent = true
-- Clipboard setup
vim.opt.clipboard = "unnamedplus"
@@ -111,7 +111,7 @@
extraConfig = ''
syntax on
set mouse=a
" --- CoC Configuration ---
" Use Tab to trigger completion and navigate
inoremap <silent><expr> <TAB>

141
home/opencode.nix Normal file
View File

@@ -0,0 +1,141 @@
{
pkgs,
lib,
unstable,
config,
...
}:
{
home.packages = with pkgs; [
opencode
];
programs.opencode = {
enable = true;
enableMcpIntegration = true;
settings = {
model = "anthropic/claude-sonnet-4-20250514";
small_model = "anthropic/claude-haiku-4-5";
autoshare = false;
autoupdate = false;
};
agents = {
code-reviewer = ''
# Code Reviewer Agent
You are a senior software engineer specializing in code reviews.
Focus on code quality, security, and maintainability.
## Guidelines
- Review for potential bugs and edge cases
- Check for security vulnerabilities
- Ensure code follows best practices
- Suggest improvements for readability and performance
'';
debugger = ''
# Debugger Agent
You are a software engineer specializing in debugging and troubleshooting.
Focus on identifying issues, providing insights into existing bugs, and suggesting improvements to the debugging process.
## Guidelines
- Look for unhandled exceptions, crashes, or error states.
- Identify and remove redundant or unnecessary debug/print statements.
- Check for proper logging practices: ensure log levels (info, debug, error) are used correctly.
- Examine error messages for clarity and contextensure they aid in troubleshooting.
- Look for missing or incorrect error handling and suggest improvements.
- Trace the flow of execution to catch logical or state-related bugs.
- Ensure relevant variable states are being monitored during runtime to spot anomalies.
- Suggest improvements to breakpoints, watchpoints, or other debugging tools for better visibility.
- Look for performance bottlenecks that could be causing issues and suggest optimizations.
- Check for edge cases and race conditions that might not be covered by current debugging.
- Ensure debugging steps or tools dont affect production environments (i.e., avoid verbose logging in production).
- Document findings and proposed fixes clearly for future reference.
'';
simplifier = ''
# Simplifier Agent
You are a software engineer specializing in simplifying and refactoring complex code.
Focus on making the code more readable, maintainable, and easier to understand without altering its functionality.
## Guidelines
- Break down long or complex functions into smaller, well-named helper functions or methods.
- Identify and remove any redundant or duplicate logic, consolidating wherever possible.
- Use more descriptive variable and function names to improve clarity.
- Simplify nested loops or conditionals (e.g., consider early returns to reduce indentation).
- Replace complex data structures or algorithms with simpler, more efficient alternatives if appropriate.
- Refactor complex conditional logic (e.g., using polymorphism, strategy pattern, or lookup tables where applicable).
- Replace hardcoded values with constants or configuration variables to improve flexibility.
- Group related logic together to improve cohesion within classes or functions.
- Ensure the code follows the DRY (Don't Repeat Yourself) principle and refactor to remove duplication.
- Simplify error handling by centralizing common error paths or using more consistent exception handling.
- Remove unnecessary comments or redundant code that doesnt add value to readability.
- Check for opportunities to use built-in language features or libraries to reduce custom code (e.g., use `map()` instead of for-loops in Python).
- Ensure code is modular and maintainable, facilitating easier testing and future updates.
- Use early exits or guard clauses to minimize nested logic and make the code more straightforward.
'';
};
commands = {
commit = ''
# Commit Command
Create a git commit with proper message formatting following conventional commits.
Usage: /commit [message]
'';
};
rules = ''
### **General Project Guidelines**
#### **Separation of Concerns**
* Keep your code **loosely coupled** components/modules should only know about what they need.
* Maintain clear **separation between domain logic and business logic** ensure your domain layer is independent of infrastructure or framework specific details.
* Ensure **separation of data concerns** never mix UI data, business data, and domain entities in a single layer.
#### **Typing and Type Safety**
* **Always define types** explicitly for variables, parameters, and return values.
* Avoid using `any` if you're unsure about a type, lean on **unknown** or **generics** until you can define it properly.
* **Interfaces and Types** should be descriptive and reusable prefer interfaces for object shapes, and types for unions/intersections or specific business rules.
* Avoid overcomplicating types focus on clarity and consistency.
#### **Code Simplicity**
* Write **simple, understandable code** don't over engineer solutions unless absolutely necessary.
* Keep methods and functions **small and focused** follow the Single Responsibility Principle.
* **Comment only when necessary** to explain complex or non obvious patterns **no comments for simple or self explanatory code**.
#### **Production-Ready Code**
* Always write **production-grade code** optimize for maintainability, readability, and scalability.
* Ensure **robust error handling** catch edge cases, validate inputs, and handle exceptions gracefully.
#### **Framework and Library Usage**
* Use frameworks and libraries **where they make sense**, but avoid unnecessary dependencies, we usually want to keep dependencies down.
* Follow **framework best practices** for structure, state management, and lifecycle methods
* Keep **UI and business logic separate** don't directly tie your UI components to business logic; use hooks or services to handle interactions.
#### **Documentation**
* **Document key architecture decisions** especially if they are complex or non intuitive.
* Only document the **why** and **how** when it's not obvious avoid redundant or trivial comments.
* Keep your documentation to the developmentlog.md Make a new section, dont write to long, just briefely what needs to be documented.
#### **Performance Considerations**
* Optimize for **readability first**, then **performance** measure performance bottlenecks before optimizing.
* When optimizing, our first priority is finding arcitectural problems, then finding out ways to parralelize.
'';
};
}

View File

@@ -34,6 +34,7 @@
../../modules/jupyterhub.nix
../../modules/blog.nix
../../modules/ollama.nix
../../modules/docling.nix # temp for dev
../../modules/kdeconnect.nix
../../modules/desktopApplications.nix

View File

@@ -6,10 +6,13 @@
}:
{
environment.systemPackages = with pkgs; [
aider-chat-full
zip
unzip
jq
curl
wget
openssl
gdb

View File

@@ -6,30 +6,40 @@
}:
{
environment.systemPackages = [
(pkgs.catppuccin-sddm.override {
flavor = "mocha";
accent = "teal";
fontSize = "24";
background = ../home/Wallpapers/1346679.jpg;
loginBackground = true;
})
];
services.displayManager = {
enable = true;
sessionPackages = with pkgs; [ niri ];
defaultSession = "niri";
sddm = {
enable = true;
autoNumlock = true;
enableHidpi = true;
wayland.enable = true;
theme = "catppuccin-mocha-teal";
package = pkgs.kdePackages.sddm;
};
lemurs.enable = true;
};
#environment.systemPackages = [
# (pkgs.catppuccin-sddm.override {
# flavor = "mocha";
# accent = "teal";
# fontSize = "24";
# background = ../home/Wallpapers/1346679.jpg;
# loginBackground = true;
# })
#];
#services.displayManager = {
# enable = true;
# sessionPackages = with pkgs; [ niri ];
# defaultSession = "niri";
# sddm = {
# enable = true;
# autoNumlock = true;
# enableHidpi = true;
# wayland.enable = true;
# theme = "catppuccin-mocha-teal";
# package = pkgs.kdePackages.sddm;
# };
#};
}

20
modules/docling.nix Normal file
View File

@@ -0,0 +1,20 @@
{
config,
pkgs,
lib,
...
}:
{
nixpkgs.config.allowBroken = true;
services.docling-serve = {
enable = true;
port = 5001;
host = "127.0.0.1";
openFirewall = true;
#environment
#environmentFile
};
}