Compare commits
No commits in common. "d219a5c4e1d753a268c58ae57ab8b771923a72a9" and "9b9c0d90a32b464e04971b0dbed61c417d8489b3" have entirely different histories.
d219a5c4e1
...
9b9c0d90a3
3 changed files with 480 additions and 522 deletions
|
@ -1,271 +0,0 @@
|
||||||
# SPDX-FileCopyrightText: 2025 Ethan Reece <contact@ethanreece.com>
|
|
||||||
#
|
|
||||||
# SPDX-License-Identifier: MIT
|
|
||||||
|
|
||||||
{
|
|
||||||
config,
|
|
||||||
inputs,
|
|
||||||
lib,
|
|
||||||
pkgs,
|
|
||||||
system,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
let
|
|
||||||
llm = {
|
|
||||||
remote = {
|
|
||||||
key = "openrouter";
|
|
||||||
name = "OpenRouter";
|
|
||||||
url = "https://openrouter.ai/api/v1";
|
|
||||||
env = "OPENROUTER_API_KEY";
|
|
||||||
models = {
|
|
||||||
fast = {
|
|
||||||
key = "moonshotai/kimi-k2:free";
|
|
||||||
name = "Kimi K2 (free)";
|
|
||||||
provider = [ "chutes/fp8" ];
|
|
||||||
tools = true;
|
|
||||||
tool_call = false;
|
|
||||||
reasoning = false;
|
|
||||||
temperature = true;
|
|
||||||
vision = true;
|
|
||||||
};
|
|
||||||
coding = {
|
|
||||||
key = "moonshotai/kimi-k2";
|
|
||||||
name = "Kimi K2";
|
|
||||||
provider = [ "groq" ];
|
|
||||||
tools = true;
|
|
||||||
tool_call = false;
|
|
||||||
reasoning = false;
|
|
||||||
temperature = true;
|
|
||||||
vision = true;
|
|
||||||
};
|
|
||||||
reasoning = {
|
|
||||||
key = "deepseek/deepseek-r1-0528:free";
|
|
||||||
name = "R1 (free)";
|
|
||||||
provider = [ "chutes" ];
|
|
||||||
tools = true;
|
|
||||||
tool_call = false;
|
|
||||||
reasoning = true;
|
|
||||||
temperature = true;
|
|
||||||
vision = true;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
in
|
|
||||||
{
|
|
||||||
imports = [ inputs.sops-nix.homeManagerModules.sops ];
|
|
||||||
sops = {
|
|
||||||
secrets = {
|
|
||||||
openrouter_api_key = { };
|
|
||||||
};
|
|
||||||
defaultSopsFile = ../sops/secrets.yaml;
|
|
||||||
};
|
|
||||||
programs = {
|
|
||||||
nushell = {
|
|
||||||
environmentVariables = {
|
|
||||||
${llm.remote.env} = lib.hm.nushell.mkNushellInline "cat ${
|
|
||||||
config.sops.secrets."${llm.remote.key}_api_key".path
|
|
||||||
}";
|
|
||||||
shellAliases = {
|
|
||||||
aichat_reasoning_remote = "${pkgs.aichat}/bin/aichat --model ${llm.remote.key}:${llm.remote.models.reasoning.key}";
|
|
||||||
aichat_fast_remote = "${pkgs.aichat}/bin/aichat --model ${llm.remote.key}:${llm.remote.models.fast.key}";
|
|
||||||
codex_remote = "${pkgs.codex}/bin/codex --profile fast_remote";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
codex = {
|
|
||||||
enable = true;
|
|
||||||
# custom-instructions = ''
|
|
||||||
# ## 10. Applying Patch Files with patch
|
|
||||||
|
|
||||||
# When the built-in `apply_patch` tool or `git apply` fails to apply a diff/patch file (especially if the file being patched contains special characters that might confuse simpler patch tools), the standard `patch` utility can be a more robust alternative.
|
|
||||||
|
|
||||||
# - **Patch File Format**: Ensure your patch file is in a standard unified diff format. Typically, these patches are generated with `git diff > my_feature.patch` or manually crafted. If the patch refers to files with `a/` and `b/` prefixes (e.g., `--- a/file.txt`, `+++ b/file.txt`), you'll use the `-p1` option.
|
|
||||||
|
|
||||||
# - **Creating the Patch File**: You can create a patch file using shell redirection, for example:
|
|
||||||
|
|
||||||
# ```bash`
|
|
||||||
# cat <<'EOF' > fix_descriptive_name.patch
|
|
||||||
# --- a/path/to/your/file.ext
|
|
||||||
# +++ b/path/to/your/file.ext
|
|
||||||
# @@ -line_num,num_lines +line_num,num_lines @@ context_or_change
|
|
||||||
# -old_line_content
|
|
||||||
# +new_line_content
|
|
||||||
# EOF
|
|
||||||
# ```
|
|
||||||
|
|
||||||
# *Important*: Ensure the `EOF` marker is on its own line with no trailing spaces.
|
|
||||||
|
|
||||||
# - **Applying the Patch**: Use the `patch` command via the `shell` tool. The `-p1` option strips the leading component from file paths in the patch file (`a/`, `b/`).
|
|
||||||
|
|
||||||
# ```
|
|
||||||
# # Example: Apply a patch file
|
|
||||||
# default_api.shell(command=["sh", "-c", "patch -p1 < fix_descriptive_name.patch"])
|
|
||||||
# ```
|
|
||||||
|
|
||||||
# - **Verification**: After applying, always verify that the target file has been changed as expected (e.g., using `cat` or `git diff`).
|
|
||||||
|
|
||||||
# - **Cleanup**: Remove the patch file if it's no longer needed:
|
|
||||||
|
|
||||||
# ```
|
|
||||||
# default_api.shell(command=["rm", "fix_descriptive_name.patch"])
|
|
||||||
# ```
|
|
||||||
# '';
|
|
||||||
settings = {
|
|
||||||
model = llm.remote.models.fast.key;
|
|
||||||
model_provider = llm.remote.key;
|
|
||||||
model_providers = {
|
|
||||||
${llm.remote.key} = {
|
|
||||||
name = llm.remote.name;
|
|
||||||
base_url = llm.remote.url;
|
|
||||||
env_key = llm.remote.env;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
opencode = {
|
|
||||||
enable = true;
|
|
||||||
settings = {
|
|
||||||
"$schema" = "https://opencode.ai/config.json";
|
|
||||||
provider = {
|
|
||||||
${llm.remote.key} = {
|
|
||||||
npm = "@ai-sdk/openai-compatible";
|
|
||||||
name = llm.remote.name;
|
|
||||||
options = {
|
|
||||||
baseURL = llm.remote.url;
|
|
||||||
apiKey = "{env:${llm.remote.env}}";
|
|
||||||
};
|
|
||||||
models = {
|
|
||||||
${llm.remote.models.fast.key} = (
|
|
||||||
let
|
|
||||||
model = llm.remote.models.fast;
|
|
||||||
in
|
|
||||||
{
|
|
||||||
id = model.key;
|
|
||||||
name = model.name;
|
|
||||||
options = {
|
|
||||||
tools = model.tools;
|
|
||||||
${llm.remote.name} = {
|
|
||||||
provider = {
|
|
||||||
order = model.provider;
|
|
||||||
allow_fallbacks = false;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
tool_call = model.tool_call;
|
|
||||||
reasoning = model.reasoning;
|
|
||||||
temperature = model.temperature;
|
|
||||||
}
|
|
||||||
);
|
|
||||||
${llm.remote.models.coding.key} = (
|
|
||||||
let
|
|
||||||
model = llm.remote.models.coding;
|
|
||||||
in
|
|
||||||
{
|
|
||||||
id = model.key;
|
|
||||||
name = model.name;
|
|
||||||
options = {
|
|
||||||
tools = model.tools;
|
|
||||||
${llm.remote.name} = {
|
|
||||||
provider = {
|
|
||||||
order = model.provider;
|
|
||||||
allow_fallbacks = false;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
tool_call = model.tool_call;
|
|
||||||
reasoning = model.reasoning;
|
|
||||||
temperature = model.temperature;
|
|
||||||
}
|
|
||||||
);
|
|
||||||
${llm.remote.models.reasoning.key} = (
|
|
||||||
let
|
|
||||||
model = llm.remote.models.reasoning;
|
|
||||||
in
|
|
||||||
{
|
|
||||||
id = model.key;
|
|
||||||
name = model.name;
|
|
||||||
options = {
|
|
||||||
tools = model.tools;
|
|
||||||
${llm.remote.name} = {
|
|
||||||
provider = {
|
|
||||||
order = model.provider;
|
|
||||||
allow_fallbacks = false;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
tool_call = model.tool_call;
|
|
||||||
reasoning = model.reasoning;
|
|
||||||
temperature = model.temperature;
|
|
||||||
}
|
|
||||||
);
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
model = "${llm.remote.key}:${llm.remote.models.fast.key}";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
aichat = {
|
|
||||||
enable = true;
|
|
||||||
settings = {
|
|
||||||
model = "${llm.remote.key}:${llm.remote.models.fast.key}";
|
|
||||||
clients = [
|
|
||||||
# {
|
|
||||||
# type = "openai-compatible";
|
|
||||||
# name = "ollama";
|
|
||||||
# api_base = "http://localhost:11434/v1";
|
|
||||||
# models = [
|
|
||||||
# {
|
|
||||||
# name = "${localFastModel}";
|
|
||||||
# supports_function_calling = true;
|
|
||||||
# supports_vision = true;
|
|
||||||
# }
|
|
||||||
# {
|
|
||||||
# name = "${localReasoningModel}";
|
|
||||||
# supports_function_calling = true;
|
|
||||||
# supports_vision = true;
|
|
||||||
# }
|
|
||||||
# ];
|
|
||||||
# }
|
|
||||||
{
|
|
||||||
type = "openai-compatible";
|
|
||||||
name = llm.remote.key;
|
|
||||||
api_base = llm.remote.url;
|
|
||||||
models = [
|
|
||||||
(
|
|
||||||
let
|
|
||||||
model = llm.remote.models.fast;
|
|
||||||
in
|
|
||||||
{
|
|
||||||
name = model.key;
|
|
||||||
supports_function_calling = model.tools;
|
|
||||||
supports_vision = model.vision;
|
|
||||||
}
|
|
||||||
)
|
|
||||||
(
|
|
||||||
let
|
|
||||||
model = llm.remote.models.coding;
|
|
||||||
in
|
|
||||||
{
|
|
||||||
name = model.key;
|
|
||||||
supports_function_calling = model.tools;
|
|
||||||
supports_vision = model.vision;
|
|
||||||
}
|
|
||||||
)
|
|
||||||
(
|
|
||||||
let
|
|
||||||
model = llm.remote.models.reasoning;
|
|
||||||
in
|
|
||||||
{
|
|
||||||
name = model.key;
|
|
||||||
supports_function_calling = model.tools;
|
|
||||||
supports_vision = model.vision;
|
|
||||||
}
|
|
||||||
)
|
|
||||||
];
|
|
||||||
}
|
|
||||||
];
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
|
@ -2,22 +2,71 @@
|
||||||
#
|
#
|
||||||
# SPDX-License-Identifier: MIT
|
# SPDX-License-Identifier: MIT
|
||||||
|
|
||||||
# TODO: Add `gitui`, `opencode`
|
# TODO: Add `eza`, `gitui`, `opencode`
|
||||||
|
|
||||||
{
|
{
|
||||||
config,
|
config,
|
||||||
inputs,
|
inputs,
|
||||||
|
lib,
|
||||||
pkgs,
|
pkgs,
|
||||||
|
system,
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
|
let
|
||||||
|
llm = {
|
||||||
|
remote = {
|
||||||
|
key = "openrouter";
|
||||||
|
name = "OpenRouter";
|
||||||
|
url = "https://openrouter.ai/api/v1";
|
||||||
|
env = "OPENROUTER_API_KEY";
|
||||||
|
models = {
|
||||||
|
fast = {
|
||||||
|
key = "moonshotai/kimi-k2:free";
|
||||||
|
name = "Kimi K2 (free)";
|
||||||
|
provider = [ "chutes/fp8" ];
|
||||||
|
tools = true;
|
||||||
|
tool_call = false;
|
||||||
|
reasoning = false;
|
||||||
|
temperature = true;
|
||||||
|
vision = true;
|
||||||
|
};
|
||||||
|
coding = {
|
||||||
|
key = "moonshotai/kimi-k2";
|
||||||
|
name = "Kimi K2";
|
||||||
|
provider = [ "groq" ];
|
||||||
|
tools = true;
|
||||||
|
tool_call = false;
|
||||||
|
reasoning = false;
|
||||||
|
temperature = true;
|
||||||
|
vision = true;
|
||||||
|
};
|
||||||
|
reasoning = {
|
||||||
|
key = "deepseek/deepseek-r1-0528:free";
|
||||||
|
name = "R1 (free)";
|
||||||
|
provider = [ "chutes" ];
|
||||||
|
tools = true;
|
||||||
|
tool_call = false;
|
||||||
|
reasoning = true;
|
||||||
|
temperature = true;
|
||||||
|
vision = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
in
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
inputs.catppuccin.homeModules.catppuccin
|
inputs.catppuccin.homeModules.catppuccin
|
||||||
inputs.lix-module.nixosModules.default
|
inputs.lix-module.nixosModules.default
|
||||||
|
inputs.sops-nix.homeManagerModules.sops
|
||||||
inputs.stylix.homeModules.stylix
|
inputs.stylix.homeModules.stylix
|
||||||
./ai.nix
|
|
||||||
./shell.nix
|
|
||||||
];
|
];
|
||||||
|
sops = {
|
||||||
|
secrets = {
|
||||||
|
openrouter_api_key = { };
|
||||||
|
};
|
||||||
|
defaultSopsFile = ../sops/secrets.yaml;
|
||||||
|
};
|
||||||
# https://nix-community.github.io/stylix/options/modules/alacritty.html
|
# https://nix-community.github.io/stylix/options/modules/alacritty.html
|
||||||
stylix = (import ../stylix { inherit config pkgs; }) // {
|
stylix = (import ../stylix { inherit config pkgs; }) // {
|
||||||
targets = {
|
targets = {
|
||||||
|
@ -65,6 +114,11 @@
|
||||||
pkgs.xz
|
pkgs.xz
|
||||||
];
|
];
|
||||||
file = { };
|
file = { };
|
||||||
|
shell = {
|
||||||
|
enableNushellIntegration = true;
|
||||||
|
enableZshIntegration = true;
|
||||||
|
enableFishIntegration = true;
|
||||||
|
};
|
||||||
sessionVariables = {
|
sessionVariables = {
|
||||||
EDITOR = "hx";
|
EDITOR = "hx";
|
||||||
};
|
};
|
||||||
|
@ -73,19 +127,25 @@
|
||||||
home-manager = {
|
home-manager = {
|
||||||
enable = true;
|
enable = true;
|
||||||
};
|
};
|
||||||
bat = {
|
|
||||||
enable = true;
|
|
||||||
};
|
|
||||||
man = {
|
man = {
|
||||||
enable = true;
|
enable = true;
|
||||||
};
|
};
|
||||||
vim = {
|
|
||||||
enable = true;
|
|
||||||
};
|
|
||||||
# TODO: Disable Guix integration
|
# TODO: Disable Guix integration
|
||||||
# password-store = {
|
# password-store = {
|
||||||
# enable = true;
|
# enable = true;
|
||||||
# };
|
# };
|
||||||
|
bat = {
|
||||||
|
enable = true;
|
||||||
|
};
|
||||||
|
nix-your-shell = {
|
||||||
|
enable = true;
|
||||||
|
};
|
||||||
|
fzf = {
|
||||||
|
enable = true;
|
||||||
|
};
|
||||||
|
vim = {
|
||||||
|
enable = true;
|
||||||
|
};
|
||||||
helix = {
|
helix = {
|
||||||
enable = true;
|
enable = true;
|
||||||
defaultEditor = true;
|
defaultEditor = true;
|
||||||
|
@ -95,6 +155,211 @@
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
nushell = {
|
||||||
|
enable = true;
|
||||||
|
environmentVariables = {
|
||||||
|
${llm.remote.env} = lib.hm.nushell.mkNushellInline "cat ${
|
||||||
|
config.sops.secrets."${llm.remote.key}_api_key".path
|
||||||
|
}";
|
||||||
|
};
|
||||||
|
settings = {
|
||||||
|
completions = {
|
||||||
|
algorithm = "fuzzy";
|
||||||
|
case_sensitive = false;
|
||||||
|
external = {
|
||||||
|
enable = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
# set -x ZATHURA_PLUGINS_PATH $GUIX_HOME/lib/zathura
|
||||||
|
shellAliases = {
|
||||||
|
aichat_reasoning_remote = "${pkgs.aichat}/bin/aichat --model ${llm.remote.key}:${llm.remote.models.reasoning.key}";
|
||||||
|
aichat_fast_remote = "${pkgs.aichat}/bin/aichat --model ${llm.remote.key}:${llm.remote.models.fast.key}";
|
||||||
|
codex_remote = "${pkgs.codex}/bin/codex --profile fast_remote";
|
||||||
|
hotspot = "sudo sysctl net.ipv4.ip_default_ttl=65";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
starship = {
|
||||||
|
enable = true;
|
||||||
|
settings = {
|
||||||
|
format =
|
||||||
|
"[](red)"
|
||||||
|
+ "$os"
|
||||||
|
+ "$username"
|
||||||
|
+ "[](bg:peach fg:red)"
|
||||||
|
+ "$directory"
|
||||||
|
+ "[](bg:yellow fg:peach)"
|
||||||
|
+ "$git_branch"
|
||||||
|
+ "$git_status"
|
||||||
|
+ "[](fg:yellow bg:green)"
|
||||||
|
+ "$c"
|
||||||
|
+ "$rust"
|
||||||
|
+ "$golang"
|
||||||
|
+ "$nodejs"
|
||||||
|
+ "$php"
|
||||||
|
+ "$java"
|
||||||
|
+ "$kotlin"
|
||||||
|
+ "$haskell"
|
||||||
|
+ "$python"
|
||||||
|
+ "[](fg:green bg:sapphire)"
|
||||||
|
+ "$conda"
|
||||||
|
+ "$nix_shell"
|
||||||
|
+ "[](fg:sapphire bg:lavender)"
|
||||||
|
+ "$time"
|
||||||
|
+ "[ ](fg:lavender)"
|
||||||
|
+ "$cmd_duration"
|
||||||
|
+ "$line_break"
|
||||||
|
+ "$character";
|
||||||
|
os = {
|
||||||
|
disabled = false;
|
||||||
|
style = "bg:red fg:crust";
|
||||||
|
symbols = {
|
||||||
|
Windows = "";
|
||||||
|
Ubuntu = "";
|
||||||
|
SUSE = "";
|
||||||
|
Raspbian = "";
|
||||||
|
Mint = "";
|
||||||
|
Macos = "";
|
||||||
|
Manjaro = "";
|
||||||
|
Linux = "";
|
||||||
|
Gentoo = "";
|
||||||
|
Fedora = "";
|
||||||
|
Alpine = "";
|
||||||
|
Amazon = "";
|
||||||
|
Android = "";
|
||||||
|
Arch = "";
|
||||||
|
Artix = "";
|
||||||
|
CentOS = "";
|
||||||
|
Debian = "";
|
||||||
|
Redhat = "";
|
||||||
|
RedHatEnterprise = "";
|
||||||
|
NixOS = "";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
username = {
|
||||||
|
show_always = true;
|
||||||
|
style_user = "bg:red fg:crust";
|
||||||
|
style_root = "bg:red fg:crust";
|
||||||
|
format = ''[ $user]($style)'';
|
||||||
|
};
|
||||||
|
directory = {
|
||||||
|
style = "bg:peach fg:crust";
|
||||||
|
format = "[ $path ]($style)";
|
||||||
|
truncation_length = 3;
|
||||||
|
truncation_symbol = "…/";
|
||||||
|
substitutions = {
|
||||||
|
"Documents" = " ";
|
||||||
|
"Downloads" = " ";
|
||||||
|
"Music" = " ";
|
||||||
|
"Pictures" = " ";
|
||||||
|
"Developer" = " ";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
git_branch = {
|
||||||
|
symbol = "";
|
||||||
|
style = "bg:yellow";
|
||||||
|
format = ''[[ $symbol $branch ](fg:crust bg:yellow)]($style)'';
|
||||||
|
};
|
||||||
|
git_status = {
|
||||||
|
style = "bg:yellow";
|
||||||
|
format = ''[[($all_status$ahead_behind )](fg:crust bg:yellow)]($style)'';
|
||||||
|
};
|
||||||
|
nodejs = {
|
||||||
|
symbol = "";
|
||||||
|
style = "bg:green";
|
||||||
|
format = ''[[ $symbol( $version) ](fg:crust bg:green)]($style)'';
|
||||||
|
};
|
||||||
|
c = {
|
||||||
|
symbol = " ";
|
||||||
|
style = "bg:green";
|
||||||
|
format = ''[[ $symbol( $version) ](fg:crust bg:green)]($style)'';
|
||||||
|
};
|
||||||
|
rust = {
|
||||||
|
symbol = "";
|
||||||
|
style = "bg:green";
|
||||||
|
format = ''[[ $symbol( $version) ](fg:crust bg:green)]($style)'';
|
||||||
|
};
|
||||||
|
golang = {
|
||||||
|
symbol = "";
|
||||||
|
style = "bg:green";
|
||||||
|
format = ''[[ $symbol( $version) ](fg:crust bg:green)]($style)'';
|
||||||
|
};
|
||||||
|
php = {
|
||||||
|
symbol = "";
|
||||||
|
style = "bg:green";
|
||||||
|
format = ''[[ $symbol( $version) ](fg:crust bg:green)]($style)'';
|
||||||
|
};
|
||||||
|
java = {
|
||||||
|
symbol = " ";
|
||||||
|
style = "bg:green";
|
||||||
|
format = ''[[ $symbol( $version) ](fg:crust bg:green)]($style)'';
|
||||||
|
};
|
||||||
|
kotlin = {
|
||||||
|
symbol = "";
|
||||||
|
style = "bg:green";
|
||||||
|
format = ''[[ $symbol( $version) ](fg:crust bg:green)]($style)'';
|
||||||
|
};
|
||||||
|
haskell = {
|
||||||
|
symbol = "";
|
||||||
|
style = "bg:green";
|
||||||
|
format = ''[[ $symbol( $version) ](fg:crust bg:green)]($style)'';
|
||||||
|
};
|
||||||
|
python = {
|
||||||
|
symbol = "";
|
||||||
|
style = "bg:green";
|
||||||
|
format = ''[[ $symbol( $version)(\(#$virtualenv\)) ](fg:crust bg:green)]($style)'';
|
||||||
|
};
|
||||||
|
docker_context = {
|
||||||
|
symbol = "";
|
||||||
|
style = "bg:sapphire";
|
||||||
|
format = ''[[ $symbol( $context) ](fg:crust bg:sapphire)]($style)'';
|
||||||
|
};
|
||||||
|
conda = {
|
||||||
|
symbol = " ";
|
||||||
|
style = "fg:crust bg:sapphire";
|
||||||
|
format = ''[$symbol$environment ]($style)'';
|
||||||
|
ignore_base = false;
|
||||||
|
};
|
||||||
|
nix_shell = {
|
||||||
|
symbol = "";
|
||||||
|
style = "fg:crust bg:sapphire";
|
||||||
|
format = ''[[ $symbol( $name) ](fg:crust bg:sapphire)]($style)'';
|
||||||
|
};
|
||||||
|
time = {
|
||||||
|
disabled = false;
|
||||||
|
time_format = "%R";
|
||||||
|
style = "bg:lavender";
|
||||||
|
format = ''[[ $time ](fg:crust bg:lavender)]($style)'';
|
||||||
|
};
|
||||||
|
line_break = {
|
||||||
|
disabled = false;
|
||||||
|
};
|
||||||
|
character = {
|
||||||
|
disabled = false;
|
||||||
|
success_symbol = "[❯](bold fg:green)";
|
||||||
|
error_symbol = "[❯](bold fg:red)";
|
||||||
|
vimcmd_symbol = "[❮](bold fg:green)";
|
||||||
|
vimcmd_replace_one_symbol = "[❮](bold fg:lavender)";
|
||||||
|
vimcmd_replace_symbol = "[❮](bold fg:lavender)";
|
||||||
|
vimcmd_visual_symbol = "[❮](bold fg:yellow)";
|
||||||
|
};
|
||||||
|
cmd_duration = {
|
||||||
|
show_milliseconds = true;
|
||||||
|
format = " in $duration ";
|
||||||
|
style = "bg:lavender";
|
||||||
|
disabled = false;
|
||||||
|
show_notifications = true;
|
||||||
|
min_time_to_notify = 45000;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
carapace = {
|
||||||
|
enable = true;
|
||||||
|
enableFishIntegration = false;
|
||||||
|
};
|
||||||
|
zoxide = {
|
||||||
|
enable = true;
|
||||||
|
};
|
||||||
git = {
|
git = {
|
||||||
enable = true;
|
enable = true;
|
||||||
delta = {
|
delta = {
|
||||||
|
@ -126,5 +391,211 @@
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
codex = {
|
||||||
|
enable = true;
|
||||||
|
# custom-instructions = ''
|
||||||
|
# ## 10. Applying Patch Files with patch
|
||||||
|
|
||||||
|
# When the built-in `apply_patch` tool or `git apply` fails to apply a diff/patch file (especially if the file being patched contains special characters that might confuse simpler patch tools), the standard `patch` utility can be a more robust alternative.
|
||||||
|
|
||||||
|
# - **Patch File Format**: Ensure your patch file is in a standard unified diff format. Typically, these patches are generated with `git diff > my_feature.patch` or manually crafted. If the patch refers to files with `a/` and `b/` prefixes (e.g., `--- a/file.txt`, `+++ b/file.txt`), you'll use the `-p1` option.
|
||||||
|
|
||||||
|
# - **Creating the Patch File**: You can create a patch file using shell redirection, for example:
|
||||||
|
|
||||||
|
# ```bash`
|
||||||
|
# cat <<'EOF' > fix_descriptive_name.patch
|
||||||
|
# --- a/path/to/your/file.ext
|
||||||
|
# +++ b/path/to/your/file.ext
|
||||||
|
# @@ -line_num,num_lines +line_num,num_lines @@ context_or_change
|
||||||
|
# -old_line_content
|
||||||
|
# +new_line_content
|
||||||
|
# EOF
|
||||||
|
# ```
|
||||||
|
|
||||||
|
# *Important*: Ensure the `EOF` marker is on its own line with no trailing spaces.
|
||||||
|
|
||||||
|
# - **Applying the Patch**: Use the `patch` command via the `shell` tool. The `-p1` option strips the leading component from file paths in the patch file (`a/`, `b/`).
|
||||||
|
|
||||||
|
# ```
|
||||||
|
# # Example: Apply a patch file
|
||||||
|
# default_api.shell(command=["sh", "-c", "patch -p1 < fix_descriptive_name.patch"])
|
||||||
|
# ```
|
||||||
|
|
||||||
|
# - **Verification**: After applying, always verify that the target file has been changed as expected (e.g., using `cat` or `git diff`).
|
||||||
|
|
||||||
|
# - **Cleanup**: Remove the patch file if it's no longer needed:
|
||||||
|
|
||||||
|
# ```
|
||||||
|
# default_api.shell(command=["rm", "fix_descriptive_name.patch"])
|
||||||
|
# ```
|
||||||
|
# '';
|
||||||
|
settings = {
|
||||||
|
model = llm.remote.models.fast.key;
|
||||||
|
model_provider = llm.remote.key;
|
||||||
|
model_providers = {
|
||||||
|
${llm.remote.key} = {
|
||||||
|
name = llm.remote.name;
|
||||||
|
base_url = llm.remote.url;
|
||||||
|
env_key = llm.remote.env;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
profiles = {
|
||||||
|
fast_remote = {
|
||||||
|
model = llm.remote.models.fast.key;
|
||||||
|
model_provider = llm.remote.key;
|
||||||
|
};
|
||||||
|
coding_remote = {
|
||||||
|
model = llm.remote.models.coding.key;
|
||||||
|
model_provider = llm.remote.key;
|
||||||
|
};
|
||||||
|
reasoning_remote = {
|
||||||
|
model = llm.remote.models.reasoning.key;
|
||||||
|
model_provider = llm.remote.key;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
opencode = {
|
||||||
|
enable = true;
|
||||||
|
settings = {
|
||||||
|
"$schema" = "https://opencode.ai/config.json";
|
||||||
|
provider = {
|
||||||
|
${llm.remote.key} = {
|
||||||
|
npm = "@ai-sdk/openai-compatible";
|
||||||
|
name = llm.remote.name;
|
||||||
|
options = {
|
||||||
|
baseURL = llm.remote.url;
|
||||||
|
apiKey = "{env:${llm.remote.env}}";
|
||||||
|
};
|
||||||
|
models = {
|
||||||
|
${llm.remote.models.fast.key} = (
|
||||||
|
let
|
||||||
|
model = llm.remote.models.fast;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
id = model.key;
|
||||||
|
name = model.name;
|
||||||
|
options = {
|
||||||
|
tools = model.tools;
|
||||||
|
${llm.remote.name} = {
|
||||||
|
provider = {
|
||||||
|
order = model.provider;
|
||||||
|
allow_fallbacks = false;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
tool_call = model.tool_call;
|
||||||
|
reasoning = model.reasoning;
|
||||||
|
temperature = model.temperature;
|
||||||
|
}
|
||||||
|
);
|
||||||
|
${llm.remote.models.coding.key} = (
|
||||||
|
let
|
||||||
|
model = llm.remote.models.coding;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
id = model.key;
|
||||||
|
name = model.name;
|
||||||
|
options = {
|
||||||
|
tools = model.tools;
|
||||||
|
${llm.remote.name} = {
|
||||||
|
provider = {
|
||||||
|
order = model.provider;
|
||||||
|
allow_fallbacks = false;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
tool_call = model.tool_call;
|
||||||
|
reasoning = model.reasoning;
|
||||||
|
temperature = model.temperature;
|
||||||
|
}
|
||||||
|
);
|
||||||
|
${llm.remote.models.reasoning.key} = (
|
||||||
|
let
|
||||||
|
model = llm.remote.models.reasoning;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
id = model.key;
|
||||||
|
name = model.name;
|
||||||
|
options = {
|
||||||
|
tools = model.tools;
|
||||||
|
${llm.remote.name} = {
|
||||||
|
provider = {
|
||||||
|
order = model.provider;
|
||||||
|
allow_fallbacks = false;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
tool_call = model.tool_call;
|
||||||
|
reasoning = model.reasoning;
|
||||||
|
temperature = model.temperature;
|
||||||
|
}
|
||||||
|
);
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
model = "${llm.remote.key}:${llm.remote.models.fast.key}";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
aichat = {
|
||||||
|
enable = true;
|
||||||
|
settings = {
|
||||||
|
model = "${llm.remote.key}:${llm.remote.models.fast.key}";
|
||||||
|
clients = [
|
||||||
|
{
|
||||||
|
type = "openai-compatible";
|
||||||
|
name = llm.remote.key;
|
||||||
|
api_base = llm.remote.url;
|
||||||
|
models = [
|
||||||
|
(
|
||||||
|
let
|
||||||
|
model = llm.remote.models.fast;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
name = model.key;
|
||||||
|
supports_function_calling = model.tools;
|
||||||
|
supports_vision = model.vision;
|
||||||
|
}
|
||||||
|
)
|
||||||
|
(
|
||||||
|
let
|
||||||
|
model = llm.remote.models.coding;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
name = model.key;
|
||||||
|
supports_function_calling = model.tools;
|
||||||
|
supports_vision = model.vision;
|
||||||
|
}
|
||||||
|
)
|
||||||
|
(
|
||||||
|
let
|
||||||
|
model = llm.remote.models.reasoning;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
name = model.key;
|
||||||
|
supports_function_calling = model.tools;
|
||||||
|
supports_vision = model.vision;
|
||||||
|
}
|
||||||
|
)
|
||||||
|
];
|
||||||
|
}
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
direnv = {
|
||||||
|
enable = true;
|
||||||
|
mise.enable = true;
|
||||||
|
nix-direnv.enable = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
services = {
|
||||||
|
gpg-agent = {
|
||||||
|
enable = true;
|
||||||
|
enableSshSupport = true;
|
||||||
|
pinentry = {
|
||||||
|
package = pkgs.pinentry-tty;
|
||||||
|
program = "pinentry";
|
||||||
|
};
|
||||||
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,242 +0,0 @@
|
||||||
# SPDX-FileCopyrightText: 2025 Ethan Reece <contact@ethanreece.com>
|
|
||||||
#
|
|
||||||
# SPDX-License-Identifier: MIT
|
|
||||||
|
|
||||||
{
|
|
||||||
config,
|
|
||||||
inputs,
|
|
||||||
lib,
|
|
||||||
pkgs,
|
|
||||||
system,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
{
|
|
||||||
home.shell = {
|
|
||||||
enableNushellIntegration = true;
|
|
||||||
enableZshIntegration = true;
|
|
||||||
enableFishIntegration = true;
|
|
||||||
};
|
|
||||||
programs = {
|
|
||||||
nix-your-shell = {
|
|
||||||
enable = true;
|
|
||||||
};
|
|
||||||
eza = {
|
|
||||||
enable = true;
|
|
||||||
};
|
|
||||||
fzf = {
|
|
||||||
enable = true;
|
|
||||||
};
|
|
||||||
direnv = {
|
|
||||||
enable = true;
|
|
||||||
mise.enable = true;
|
|
||||||
nix-direnv.enable = true;
|
|
||||||
};
|
|
||||||
nushell = {
|
|
||||||
enable = true;
|
|
||||||
settings = {
|
|
||||||
completions = {
|
|
||||||
algorithm = "fuzzy";
|
|
||||||
case_sensitive = false;
|
|
||||||
external = {
|
|
||||||
enable = true;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
# set -x ZATHURA_PLUGINS_PATH $GUIX_HOME/lib/zathura
|
|
||||||
shellAliases = {
|
|
||||||
hotspot = "sudo sysctl net.ipv4.ip_default_ttl=65";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
starship = {
|
|
||||||
enable = true;
|
|
||||||
settings = {
|
|
||||||
format =
|
|
||||||
"[](red)"
|
|
||||||
+ "$os"
|
|
||||||
+ "$username"
|
|
||||||
+ "[](bg:peach fg:red)"
|
|
||||||
+ "$directory"
|
|
||||||
+ "[](bg:yellow fg:peach)"
|
|
||||||
+ "$git_branch"
|
|
||||||
+ "$git_status"
|
|
||||||
+ "[](fg:yellow bg:green)"
|
|
||||||
+ "$c"
|
|
||||||
+ "$rust"
|
|
||||||
+ "$golang"
|
|
||||||
+ "$nodejs"
|
|
||||||
+ "$php"
|
|
||||||
+ "$java"
|
|
||||||
+ "$kotlin"
|
|
||||||
+ "$haskell"
|
|
||||||
+ "$python"
|
|
||||||
+ "[](fg:green bg:sapphire)"
|
|
||||||
+ "$conda"
|
|
||||||
+ "$nix_shell"
|
|
||||||
+ "[](fg:sapphire bg:lavender)"
|
|
||||||
+ "$time"
|
|
||||||
+ "[ ](fg:lavender)"
|
|
||||||
+ "$cmd_duration"
|
|
||||||
+ "$line_break"
|
|
||||||
+ "$character";
|
|
||||||
os = {
|
|
||||||
disabled = false;
|
|
||||||
style = "bg:red fg:crust";
|
|
||||||
symbols = {
|
|
||||||
Windows = "";
|
|
||||||
Ubuntu = "";
|
|
||||||
SUSE = "";
|
|
||||||
Raspbian = "";
|
|
||||||
Mint = "";
|
|
||||||
Macos = "";
|
|
||||||
Manjaro = "";
|
|
||||||
Linux = "";
|
|
||||||
Gentoo = "";
|
|
||||||
Fedora = "";
|
|
||||||
Alpine = "";
|
|
||||||
Amazon = "";
|
|
||||||
Android = "";
|
|
||||||
Arch = "";
|
|
||||||
Artix = "";
|
|
||||||
CentOS = "";
|
|
||||||
Debian = "";
|
|
||||||
Redhat = "";
|
|
||||||
RedHatEnterprise = "";
|
|
||||||
NixOS = "";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
username = {
|
|
||||||
show_always = true;
|
|
||||||
style_user = "bg:red fg:crust";
|
|
||||||
style_root = "bg:red fg:crust";
|
|
||||||
format = ''[ $user]($style)'';
|
|
||||||
};
|
|
||||||
directory = {
|
|
||||||
style = "bg:peach fg:crust";
|
|
||||||
format = "[ $path ]($style)";
|
|
||||||
truncation_length = 3;
|
|
||||||
truncation_symbol = "…/";
|
|
||||||
substitutions = {
|
|
||||||
"Documents" = " ";
|
|
||||||
"Downloads" = " ";
|
|
||||||
"Music" = " ";
|
|
||||||
"Pictures" = " ";
|
|
||||||
"Developer" = " ";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
git_branch = {
|
|
||||||
symbol = "";
|
|
||||||
style = "bg:yellow";
|
|
||||||
format = ''[[ $symbol $branch ](fg:crust bg:yellow)]($style)'';
|
|
||||||
};
|
|
||||||
git_status = {
|
|
||||||
style = "bg:yellow";
|
|
||||||
format = ''[[($all_status$ahead_behind )](fg:crust bg:yellow)]($style)'';
|
|
||||||
};
|
|
||||||
nodejs = {
|
|
||||||
symbol = "";
|
|
||||||
style = "bg:green";
|
|
||||||
format = ''[[ $symbol( $version) ](fg:crust bg:green)]($style)'';
|
|
||||||
};
|
|
||||||
c = {
|
|
||||||
symbol = " ";
|
|
||||||
style = "bg:green";
|
|
||||||
format = ''[[ $symbol( $version) ](fg:crust bg:green)]($style)'';
|
|
||||||
};
|
|
||||||
rust = {
|
|
||||||
symbol = "";
|
|
||||||
style = "bg:green";
|
|
||||||
format = ''[[ $symbol( $version) ](fg:crust bg:green)]($style)'';
|
|
||||||
};
|
|
||||||
golang = {
|
|
||||||
symbol = "";
|
|
||||||
style = "bg:green";
|
|
||||||
format = ''[[ $symbol( $version) ](fg:crust bg:green)]($style)'';
|
|
||||||
};
|
|
||||||
php = {
|
|
||||||
symbol = "";
|
|
||||||
style = "bg:green";
|
|
||||||
format = ''[[ $symbol( $version) ](fg:crust bg:green)]($style)'';
|
|
||||||
};
|
|
||||||
java = {
|
|
||||||
symbol = " ";
|
|
||||||
style = "bg:green";
|
|
||||||
format = ''[[ $symbol( $version) ](fg:crust bg:green)]($style)'';
|
|
||||||
};
|
|
||||||
kotlin = {
|
|
||||||
symbol = "";
|
|
||||||
style = "bg:green";
|
|
||||||
format = ''[[ $symbol( $version) ](fg:crust bg:green)]($style)'';
|
|
||||||
};
|
|
||||||
haskell = {
|
|
||||||
symbol = "";
|
|
||||||
style = "bg:green";
|
|
||||||
format = ''[[ $symbol( $version) ](fg:crust bg:green)]($style)'';
|
|
||||||
};
|
|
||||||
python = {
|
|
||||||
symbol = "";
|
|
||||||
style = "bg:green";
|
|
||||||
format = ''[[ $symbol( $version)(\(#$virtualenv\)) ](fg:crust bg:green)]($style)'';
|
|
||||||
};
|
|
||||||
docker_context = {
|
|
||||||
symbol = "";
|
|
||||||
style = "bg:sapphire";
|
|
||||||
format = ''[[ $symbol( $context) ](fg:crust bg:sapphire)]($style)'';
|
|
||||||
};
|
|
||||||
conda = {
|
|
||||||
symbol = " ";
|
|
||||||
style = "fg:crust bg:sapphire";
|
|
||||||
format = ''[$symbol$environment ]($style)'';
|
|
||||||
ignore_base = false;
|
|
||||||
};
|
|
||||||
nix_shell = {
|
|
||||||
symbol = "";
|
|
||||||
style = "fg:crust bg:sapphire";
|
|
||||||
format = ''[[ $symbol( $name) ](fg:crust bg:sapphire)]($style)'';
|
|
||||||
};
|
|
||||||
time = {
|
|
||||||
disabled = false;
|
|
||||||
time_format = "%R";
|
|
||||||
style = "bg:lavender";
|
|
||||||
format = ''[[ $time ](fg:crust bg:lavender)]($style)'';
|
|
||||||
};
|
|
||||||
line_break = {
|
|
||||||
disabled = false;
|
|
||||||
};
|
|
||||||
character = {
|
|
||||||
disabled = false;
|
|
||||||
success_symbol = "[❯](bold fg:green)";
|
|
||||||
error_symbol = "[❯](bold fg:red)";
|
|
||||||
vimcmd_symbol = "[❮](bold fg:green)";
|
|
||||||
vimcmd_replace_one_symbol = "[❮](bold fg:lavender)";
|
|
||||||
vimcmd_replace_symbol = "[❮](bold fg:lavender)";
|
|
||||||
vimcmd_visual_symbol = "[❮](bold fg:yellow)";
|
|
||||||
};
|
|
||||||
cmd_duration = {
|
|
||||||
show_milliseconds = true;
|
|
||||||
format = " in $duration ";
|
|
||||||
style = "bg:lavender";
|
|
||||||
disabled = false;
|
|
||||||
show_notifications = true;
|
|
||||||
min_time_to_notify = 45000;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
carapace = {
|
|
||||||
enable = true;
|
|
||||||
enableFishIntegration = false;
|
|
||||||
};
|
|
||||||
zoxide = {
|
|
||||||
enable = true;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
services = {
|
|
||||||
gpg-agent = {
|
|
||||||
enable = true;
|
|
||||||
enableSshSupport = true;
|
|
||||||
pinentry = {
|
|
||||||
package = pkgs.pinentry-tty;
|
|
||||||
program = "pinentry";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
Loading…
Add table
Reference in a new issue