631 lines
20 KiB
Nix
631 lines
20 KiB
Nix
{
|
|
inputs,
|
|
config,
|
|
pkgs,
|
|
...
|
|
}:
|
|
|
|
let
|
|
localFastModel = "qwen2.5-coder-num_ctx";
|
|
localReasoningModel = "deepseek-r1-num_ctx";
|
|
remoteFastModel = "deepseek/deepseek-chat-v3-0324:free"; # "qwen/qwen-2.5-coder-32b-instruct:free";
|
|
remoteReasoningModel = "deepseek/deepseek-r1-0528:free";
|
|
in
|
|
{
|
|
nixGL = {
|
|
packages = import inputs.nixgl {
|
|
inherit pkgs;
|
|
enable32bits = false;
|
|
enableIntelX86Extensions = false;
|
|
};
|
|
defaultWrapper = "mesa";
|
|
installScripts = [ "mesa" ];
|
|
vulkan.enable = true;
|
|
};
|
|
home = {
|
|
stateVersion = "24.11";
|
|
username = "sudoer777";
|
|
homeDirectory = "/home/sudoer777";
|
|
language.base = "eo.utf8";
|
|
packages = [
|
|
pkgs.acpi
|
|
pkgs.bitwarden-desktop # TODO: switch to rbw
|
|
pkgs.bzip3
|
|
# pkgs.cacert - TODO: should be used on NixOS
|
|
# pkgs.cups - TODO: should be used on NixOS
|
|
pkgs.curl
|
|
pkgs.dino
|
|
pkgs.e2fsprogs
|
|
pkgs.element-desktop # TODO: switch to programs.element-desktop
|
|
pkgs.file
|
|
# pkgs.firefox
|
|
# pkgs.firefoxpwa - requires system access
|
|
pkgs.gzip
|
|
pkgs.gnutar
|
|
# pkgs.high-tide - doesn't work
|
|
pkgs.iproute2
|
|
pkgs.iputils
|
|
pkgs.julia
|
|
(config.lib.nixGL.wrap pkgs.kdePackages.audiotube)
|
|
pkgs.kdePackages.dolphin
|
|
pkgs.kdePackages.falkon
|
|
pkgs.ladybird
|
|
# pkgs.languagetool - TODO: should be used on NixOS
|
|
pkgs.libreoffice-fresh
|
|
pkgs.librewolf # TODO: switch to programs.librewolf
|
|
pkgs.lm_sensors
|
|
pkgs.logseq # TODO: switch to joplin-desktop
|
|
pkgs.lsof
|
|
pkgs.mailutils
|
|
pkgs.mupdf
|
|
# pkgs.ncurses
|
|
pkgs.nixd
|
|
pkgs.pijul
|
|
pkgs.procps # TODO: switch to uutils when available
|
|
pkgs.procs
|
|
pkgs.psmisc
|
|
pkgs.signal-desktop
|
|
# pkgs.simplex-chat-desktop - not available on aarch64
|
|
# pkgs.slacky - doesn't work, requires update
|
|
pkgs.speedtest-cli
|
|
pkgs.strace
|
|
# pkgs.sudo-rs - TODO: should be used on NixOS
|
|
pkgs.tcpdump
|
|
pkgs.teams-for-linux # TODO: Move to flake in UTD folder
|
|
pkgs.telegram-desktop
|
|
# pkgs.tidal-hifi - aarch64 build broken
|
|
pkgs.util-linux # TODO: switch to uutils when available
|
|
pkgs.uutils-coreutils-noprefix
|
|
pkgs.uutils-diffutils
|
|
pkgs.uutils-findutils
|
|
# pkgs.widevine-cdm - doesn't work
|
|
pkgs.wget
|
|
pkgs.xz
|
|
];
|
|
file = { };
|
|
sessionVariables = { };
|
|
};
|
|
programs = {
|
|
home-manager = {
|
|
enable = true;
|
|
};
|
|
chromium = {
|
|
enable = true;
|
|
};
|
|
freetube = {
|
|
enable = true;
|
|
package = (config.lib.nixGL.wrap pkgs.freetube);
|
|
settings = {
|
|
rememberHistory = false;
|
|
rememberSearchHistory = false;
|
|
saveWatchedProgress = false;
|
|
checkForUpdates = false;
|
|
autoplayVideos = false;
|
|
useSponsorBlock = true;
|
|
useDeArrowTitles = true;
|
|
useDeArrowThumbnails = true;
|
|
};
|
|
};
|
|
mpv = {
|
|
enable = true;
|
|
};
|
|
feh = {
|
|
enable = true;
|
|
};
|
|
# TODO: Disable Guix integration
|
|
# zathura = {
|
|
# enable = true;
|
|
# };
|
|
man = {
|
|
enable = true;
|
|
};
|
|
# TODO: Disable Guix integration
|
|
# password-store = {
|
|
# enable = true;
|
|
# };
|
|
bat = {
|
|
enable = true;
|
|
};
|
|
nix-your-shell = {
|
|
enable = true;
|
|
};
|
|
wezterm = {
|
|
enable = true;
|
|
};
|
|
fzf = {
|
|
enable = true;
|
|
};
|
|
vim = {
|
|
enable = true;
|
|
};
|
|
yt-dlp = {
|
|
enable = true;
|
|
};
|
|
helix = {
|
|
enable = true;
|
|
defaultEditor = true;
|
|
settings = {
|
|
editor.soft-wrap = {
|
|
enable = true;
|
|
};
|
|
};
|
|
};
|
|
# TODO: Disable Guix integration
|
|
# nushell = {
|
|
# enable = true;
|
|
# settings = {
|
|
# completions = {
|
|
# algorithm = "fuzzy";
|
|
# external.enable = true;
|
|
# };
|
|
# };
|
|
# shellAliases = {
|
|
# aichat_reasoning_remote = "aichat --model openrouter:${remoteReasoningModel}";
|
|
# aichat_reasoning_local = "aichat --model ollama:${localReasoningModel}";
|
|
# aichat_fast_remote = "aichat --model openrouter:${remoteFastModel}";
|
|
# aichat_fast_local = "aichat --model ollama:${localFastModel}";
|
|
# codex_remote = "codex --provider openrouter --model ${remoteFastModel}";
|
|
# codex_local = "codex --provider ollama --model ${localFastModel}";
|
|
# };
|
|
# };
|
|
# TODO: Disable Guix integration
|
|
# starship = {
|
|
# enable = true;
|
|
# };
|
|
# carapace = {
|
|
# enable = true;
|
|
# };
|
|
# TODO: Disable Guix integration
|
|
# kitty = {
|
|
# enable = true;
|
|
# enableGitIntegration = true;
|
|
# font = {
|
|
# package = pkgs.nerd-fonts.jetbrains-mono;
|
|
# # Add name?
|
|
# };
|
|
# settings = {
|
|
# clipboard_control = ["write-primary" "write-clipboard" "no-append"];
|
|
# };
|
|
# };
|
|
git = {
|
|
enable = true;
|
|
delta = {
|
|
enable = true;
|
|
};
|
|
signing = {
|
|
format = "openpgp";
|
|
signByDefault = true;
|
|
};
|
|
userEmail = "contact@ethanreece.com";
|
|
userName = "Ethan Reece";
|
|
};
|
|
gh = {
|
|
enable = true;
|
|
settings = {
|
|
git_protocol = "ssh";
|
|
};
|
|
};
|
|
jujutsu = {
|
|
enable = true;
|
|
settings = {
|
|
user = {
|
|
name = "Ethan Reece";
|
|
email = "contact@ethanreece.com";
|
|
};
|
|
signing = {
|
|
behavior = "own";
|
|
backend = "gpg";
|
|
};
|
|
};
|
|
};
|
|
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 = "${localFastModel}";
|
|
provider = "ollama";
|
|
providers = {
|
|
ollama = {
|
|
name = "Ollama";
|
|
baseURL = "http://localhost:11434/v1";
|
|
envKey = "OLLAMA_API_KEY";
|
|
};
|
|
openrouter = {
|
|
name = "OpenRouter";
|
|
baseURL = "https://openrouter.ai/api/v1";
|
|
envKey = "OPENROUTER_API_KEY";
|
|
};
|
|
};
|
|
};
|
|
};
|
|
aichat = {
|
|
enable = true;
|
|
settings = {
|
|
model = "ollama:${localFastModel}";
|
|
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 = "openrouter";
|
|
api_base = "https://openrouter.ai/api/v1";
|
|
models = [
|
|
{
|
|
name = "${remoteFastModel}";
|
|
supports_function_calling = true;
|
|
supports_vision = true;
|
|
}
|
|
{
|
|
name = "${remoteReasoningModel}";
|
|
supports_function_calling = true;
|
|
supports_vision = true;
|
|
}
|
|
];
|
|
}
|
|
];
|
|
};
|
|
};
|
|
direnv = {
|
|
enable = true;
|
|
mise.enable = true;
|
|
nix-direnv.enable = true;
|
|
};
|
|
vesktop = {
|
|
enable = true;
|
|
package = (config.lib.nixGL.wrap pkgs.vesktop);
|
|
settings = {
|
|
discordBranch = "canary";
|
|
minimizeToTray = true;
|
|
arRPC = true;
|
|
splashColor = "color(srgb 0.862745 0.862745 0.870588)";
|
|
splashBackground = "rgb(11, 12, 13)";
|
|
splashTheming = false;
|
|
openLinksWithElectron = false;
|
|
spellCheckLanguages = [
|
|
"en-US"
|
|
"en"
|
|
];
|
|
vencord = ./vencord.nix;
|
|
};
|
|
};
|
|
floorp = {
|
|
enable = true;
|
|
package = (config.lib.nixGL.wrap pkgs.floorp);
|
|
languagePacks = [
|
|
"eo"
|
|
"en-US"
|
|
];
|
|
policies = {
|
|
ExtensionSettings =
|
|
let
|
|
# mozilla.github.io/policy-templates
|
|
mkMozillaAddonUrl = id: "https://addons.mozilla.org/firefox/downloads/latest/${id}/latest.xpi";
|
|
in
|
|
{
|
|
"*".installation_mode = "blocked";
|
|
# PopUpOFF
|
|
"{154cddeb-4c8b-4627-a478-c7e5b427ffdf}" = {
|
|
installation_mode = "force_installed";
|
|
install_url = mkMozillaAddonUrl "{154cddeb-4c8b-4627-a478-c7e5b427ffdf}";
|
|
};
|
|
# The wall
|
|
"{4df1496d-becb-4eb8-9f3e-08a52cf3dd6a}" = {
|
|
installation_mode = "force_installed";
|
|
install_url = mkMozillaAddonUrl "{4df1496d-becb-4eb8-9f3e-08a52cf3dd6a}";
|
|
};
|
|
# MWMBL Web Crawler
|
|
"{53f57a68-a73e-4b31-ba0c-97cf722602ae}" = {
|
|
installation_mode = "force_installed";
|
|
install_url = mkMozillaAddonUrl "{53f57a68-a73e-4b31-ba0c-97cf722602ae}";
|
|
};
|
|
# Video Speed Controller
|
|
"{7be2ba16-0f1e-4d93-9ebc-5164397477a9}" = {
|
|
installation_mode = "force_installed";
|
|
install_url = mkMozillaAddonUrl "{7be2ba16-0f1e-4d93-9ebc-5164397477a9}";
|
|
};
|
|
# Boycat
|
|
"boycat@extension.io" = {
|
|
installation_mode = "force_installed";
|
|
install_url = mkMozillaAddonUrl "boycat@extension.io";
|
|
};
|
|
# Go European
|
|
"goeuropean@example.com" = {
|
|
installation_mode = "force_installed";
|
|
install_url = mkMozillaAddonUrl "goeuropean@example.com";
|
|
};
|
|
# Bypass Paywalls Clean
|
|
"magnolia@12.34.xpi" = {
|
|
installation_mode = "force_installed";
|
|
install_url = "https://gitflic.ru/project/magnolia1234/bpc_uploads/blob/?file=bypass_paywalls_clean-latest.xpi&branch=main";
|
|
};
|
|
# Sky Follower Bridge
|
|
"sky-follower-bridge@ryo.kawamata" = {
|
|
installation_mode = "force_installed";
|
|
install_url = mkMozillaAddonUrl "sky-follower-bridge@ryo.kawamata";
|
|
};
|
|
# Support Canadian
|
|
"supportcanadian@example.com" = {
|
|
installation_mode = "force_installed";
|
|
install_url = mkMozillaAddonUrl "supportcanadian@example.com";
|
|
};
|
|
# Syrup
|
|
"syrup@extension" = {
|
|
installation_mode = "force_installed";
|
|
install_url = mkMozillaAddonUrl "syrup@extension";
|
|
};
|
|
# TrackMeNot
|
|
"trackmenot@mrl.nyu.edu" = {
|
|
installation_mode = "force_installed";
|
|
install_url = mkMozillaAddonUrl "trackmenot@mrl.nyu.edu";
|
|
};
|
|
# Unhook
|
|
"myallychou@gmail.com" = {
|
|
installation_mode = "force_installed";
|
|
install_url = mkMozillaAddonUrl "myallychou@gmail.com";
|
|
};
|
|
};
|
|
SanitizeOnShutdown = true;
|
|
};
|
|
profiles.main = {
|
|
extensions = {
|
|
packages = with pkgs; [
|
|
# https://nur.nix-community.org/repos/rycee/
|
|
nur.repos.rycee.firefox-addons.adnauseam
|
|
nur.repos.rycee.firefox-addons.amp2html
|
|
nur.repos.rycee.firefox-addons.aria2-integration
|
|
nur.repos.rycee.firefox-addons.bitwarden
|
|
nur.repos.rycee.firefox-addons.blocktube
|
|
nur.repos.rycee.firefox-addons.clearurls
|
|
nur.repos.rycee.firefox-addons.cliget
|
|
nur.repos.rycee.firefox-addons.control-panel-for-twitter
|
|
nur.repos.rycee.firefox-addons.dearrow
|
|
nur.repos.rycee.firefox-addons.don-t-fuck-with-paste
|
|
nur.repos.rycee.firefox-addons.fediact
|
|
nur.repos.rycee.firefox-addons.foxyproxy-standard
|
|
nur.repos.rycee.firefox-addons.geminize
|
|
nur.repos.rycee.firefox-addons.github-file-icons
|
|
nur.repos.rycee.firefox-addons.github-issue-link-status
|
|
nur.repos.rycee.firefox-addons.ipfs-companion
|
|
nur.repos.rycee.firefox-addons.istilldontcareaboutcookies
|
|
nur.repos.rycee.firefox-addons.kagi-search
|
|
nur.repos.rycee.firefox-addons.leechblock-ng
|
|
nur.repos.rycee.firefox-addons.localcdn
|
|
nur.repos.rycee.firefox-addons.lovely-forks
|
|
nur.repos.rycee.firefox-addons.notifier-for-github
|
|
nur.repos.rycee.firefox-addons.octotree
|
|
nur.repos.rycee.firefox-addons.old-reddit-redirect
|
|
nur.repos.rycee.firefox-addons.peertubeify
|
|
nur.repos.rycee.firefox-addons.private-grammar-checker-harper
|
|
nur.repos.rycee.firefox-addons.protoots
|
|
nur.repos.rycee.firefox-addons.reddit-enhancement-suite
|
|
nur.repos.rycee.firefox-addons.shinigami-eyes
|
|
nur.repos.rycee.firefox-addons.simple-translate
|
|
nur.repos.rycee.firefox-addons.snowflake
|
|
nur.repos.rycee.firefox-addons.sponsorblock
|
|
nur.repos.rycee.firefox-addons.streetpass-for-mastodon
|
|
nur.repos.rycee.firefox-addons.terms-of-service-didnt-read
|
|
nur.repos.rycee.firefox-addons.twiter-x-video-downloader
|
|
nur.repos.rycee.firefox-addons.ublacklist
|
|
nur.repos.rycee.firefox-addons.user-agent-string-switcher
|
|
nur.repos.rycee.firefox-addons.web-archives
|
|
nur.repos.rycee.firefox-addons.web-scrobbler
|
|
nur.repos.rycee.firefox-addons.youtube-high-definition
|
|
nur.repos.rycee.firefox-addons.youtube-no-translation
|
|
nur.repos.rycee.firefox-addons.youtube-shorts-block
|
|
];
|
|
};
|
|
isDefault = true;
|
|
name = "Main";
|
|
settings = {
|
|
"extensions.autoDisableScopes" = 0;
|
|
"sidebar.verticalTabs" = true;
|
|
};
|
|
bookmarks = {
|
|
force = true;
|
|
settings = [
|
|
{
|
|
name = "DFW";
|
|
toolbar = true;
|
|
bookmarks = [
|
|
{
|
|
name = "DART Trip Planner";
|
|
url = "https://www.dart.org/trip/trip-planner/trip-planner-map";
|
|
}
|
|
];
|
|
}
|
|
{
|
|
name = "Documentation";
|
|
toolbar = true;
|
|
bookmarks = [
|
|
{
|
|
name = "Firefox Policy Templates";
|
|
url = "mozilla.github.io/policy-templates";
|
|
}
|
|
{
|
|
name = "flake-parts treefmt-nix Documentation";
|
|
url = "flake.parts/options/treefmt-nix.html";
|
|
}
|
|
{
|
|
name = "flake-parts git-hook-nix Documentation";
|
|
url = "https://flake.parts/options/git-hooks-nix.html";
|
|
}
|
|
{
|
|
name = "Guix Packages";
|
|
url = "https://toys.whereis.social/";
|
|
}
|
|
{
|
|
name = "Harper Supported Languages";
|
|
url = "https://writewithharper.com/docs/integrations/language-server#Supported-Languages";
|
|
}
|
|
{
|
|
name = "Helix Language Support";
|
|
url = "https://docs.helix-editor.com/lang-support.html";
|
|
}
|
|
{
|
|
name = "Helix Formatter Support";
|
|
url = "https://helix-editor.vercel.app/reference/formatters";
|
|
}
|
|
{
|
|
name = "Helix languages.toml";
|
|
url = "https://github.com/helix-editor/helix/blob/master/languages.toml";
|
|
}
|
|
{
|
|
name = "Home Manager Configuration Options";
|
|
url = "https://nix-community.github.io/home-manager/options.xhtml";
|
|
}
|
|
{
|
|
name = "ltex-plus Supported Languages";
|
|
url = "https://ltex-plus.github.io/ltex-plus/supported-languages.html";
|
|
}
|
|
{
|
|
name = "Nix Firefox Addons Search";
|
|
url = "https://nur.nix-community.org/repos/rycee/";
|
|
}
|
|
{
|
|
name = "NixOS Configuration Options";
|
|
url = "https://nixos.org/manual/nixos/unstable/options";
|
|
}
|
|
{
|
|
name = "NixOS Package Search";
|
|
url = "https://search.nixos.org/packages";
|
|
}
|
|
{
|
|
name = "Vale Supported Languages";
|
|
url = "https://vale.sh/docs/formats/code";
|
|
}
|
|
];
|
|
}
|
|
{
|
|
name = "Local Sites";
|
|
toolbar = true;
|
|
bookmarks = [
|
|
{
|
|
name = "CUPS";
|
|
url = "http://localhost:631/";
|
|
}
|
|
{
|
|
name = "Syncthing";
|
|
url = "http://localhost:8384/";
|
|
}
|
|
];
|
|
}
|
|
{
|
|
name = "Self-Hosting";
|
|
toolbar = true;
|
|
bookmarks = [
|
|
{
|
|
name = "ArchiveTeam Warrior";
|
|
url = "http://docker:8001/";
|
|
}
|
|
{
|
|
name = "OpenRouter Chat";
|
|
url = "https://openrouter.ai/chat";
|
|
}
|
|
{
|
|
name = "Proxmox";
|
|
url = "https://gamingserver:8006";
|
|
}
|
|
{
|
|
name = "Portainer";
|
|
url = "http://docker:9000";
|
|
}
|
|
{
|
|
name = "Syncthing";
|
|
url = "http://docker:8384/";
|
|
}
|
|
{
|
|
name = "The Indie Beat";
|
|
url = "https://theindiebeat.fm/";
|
|
}
|
|
{
|
|
name = "TrueNAS";
|
|
url = "https://10.10.10.5:444/";
|
|
}
|
|
];
|
|
}
|
|
{
|
|
name = "UT Dallas";
|
|
toolbar = true;
|
|
bookmarks = [
|
|
{
|
|
name = "Comet Calendar";
|
|
url = "https://calendar.utdallas.edu/";
|
|
}
|
|
{
|
|
name = "eLearning";
|
|
url = "https://elearning.utdallas.edu/";
|
|
}
|
|
{
|
|
name = "UT Dallas Map";
|
|
url = "https://map.utdallas.edu/";
|
|
}
|
|
];
|
|
}
|
|
];
|
|
};
|
|
};
|
|
};
|
|
};
|
|
services = {
|
|
arrpc.enable = true;
|
|
gpg-agent = {
|
|
enable = true;
|
|
enableSshSupport = true;
|
|
pinentry = {
|
|
package = pkgs.pinentry-all;
|
|
program = "pinentry";
|
|
};
|
|
};
|
|
};
|
|
targets.genericLinux.enable = true;
|
|
}
|