{ config, inputs, lib, pkgs, ... }: let username = "sudoer777"; 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 { sops = { secrets = { openrouter_api_key = { }; }; defaultSopsFile = ./secrets/secrets.yaml; age.keyFile = /home/${username}/.config/sops/age/keys.txt; }; # https://nix.catppuccin.com/search/rolling/ catppuccin = { enable = true; flavor = "mocha"; floorp.profiles.default.force = true; }; # https://nix-community.github.io/stylix/options/modules/alacritty.html stylix = { enable = true; base16Scheme = "${pkgs.base16-schemes}/share/themes/catppuccin-mocha.yaml"; image = config.lib.stylix.pixel "base0A"; polarity = "dark"; fonts = { serif = { package = pkgs.libertinus; name = "Libertinus Serif"; }; sansSerif = { package = pkgs.inter; name = "Inter"; }; monospace = { package = pkgs.nerd-fonts.jetbrains-mono; name = "JetBrains Mono Nerd Font"; }; emoji = { package = pkgs.openmoji-color; name = "OpenMoji Color"; }; }; targets = { bat.enable = false; floorp = { profileNames = [ "default" ]; }; fzf.enable = false; helix.enable = false; kitty.variant256Colors = true; starship.enable = false; }; }; nixGL = { packages = import inputs.nixgl { inherit pkgs; enable32bits = false; enableIntelX86Extensions = false; }; defaultWrapper = "mesa"; installScripts = [ "mesa" ]; vulkan.enable = true; }; home = { stateVersion = "24.11"; username = username; 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 = { }; shell = { enableNushellIntegration = true; enableZshIntegration = true; enableFishIntegration = true; }; }; 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; package = (config.lib.nixGL.wrap pkgs.wezterm); }; fzf = { enable = true; }; vim = { enable = true; }; yt-dlp = { enable = true; }; helix = { enable = true; defaultEditor = true; settings = { editor.soft-wrap = { enable = true; }; }; }; nushell = { enable = true; environmentVariables = { OPENROUTER_API_KEY = lib.hm.nushell.mkNushellInline "cat ${config.sops.secrets.openrouter_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 openrouter:${remoteReasoningModel}"; aichat_reasoning_local = "${pkgs.aichat}/bin/aichat --model ollama:${localReasoningModel}"; aichat_fast_remote = "${pkgs.aichat}/bin/aichat --model openrouter:${remoteFastModel}"; aichat_fast_local = "${pkgs.aichat}/bin/aichat --model ollama:${localFastModel}"; codex_remote = "${pkgs.codex}/bin/codex --provider openrouter --model ${remoteFastModel}"; codex_local = "${pkgs.codex}/bin/codex --provider ollama --model ${localFastModel}"; 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" + "[](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 = "󱄛"; }; }; 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; }; 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; }; kitty = { enable = true; package = (config.lib.nixGL.wrap pkgs.kitty); enableGitIntegration = true; 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"; "*".installation_mode = "allowed"; # 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"; }; }; SanitizeOnShutdown = true; HttpsOnlyMode = "force_enabled"; PromptForDownloadLocation = true; DisplayBookmarksToolbar = "newtab"; RequestedLocales = "eo,en-US"; }; profiles.default = { extensions = { force = true; 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.firefox-color nur.repos.rycee.firefox-addons.foxyproxy-standard nur.repos.rycee.firefox-addons.geminize nur.repos.rycee.firefox-addons.gesturefy 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.translate-web-pages nur.repos.rycee.firefox-addons.tree-style-tab 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 = { "dom.securecontext.allowlist_onions" = true; "extensions.autoDisableScopes" = 0; "extensions.checkCompatibility.128.0" = false; "extensions.checkCompatibility.128.1" = false; "extensions.checkCompatibility.128.10" = false; "extensions.checkCompatibility.128.11" = false; "extensions.checkCompatibility.128.12" = false; "extensions.checkCompatibility.128.13" = false; "extensions.checkCompatibility.128.14" = false; "extensions.checkCompatibility.128.15" = false; "extensions.checkCompatibility.128.2" = false; "extensions.checkCompatibility.128.3" = false; "extensions.checkCompatibility.128.4" = false; "extensions.checkCompatibility.128.5" = false; "extensions.checkCompatibility.128.6" = false; "extensions.checkCompatibility.128.7" = false; "extensions.checkCompatibility.128.8" = false; "extensions.checkCompatibility.128.9" = false; "extensions.checkCompatibility.nightly" = false; "floorp.browser.sidebar.enable" = false; "floorp.browser.sidebar.is.displayed" = false; "floorp.browser.ssb.enabled" = true; "floorp.browser.tabs.verticaltab" = true; "floorp.tabsleep.enabled" = true; "floorp.titlebar.favicon.color" = true; "floorp.verticaltab.hover.enabled" = true; "network.dns.blockDotOnion" = false; }; 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 = "Catppuccin Options"; url = "https://nix.catppuccin.com/search/rolling/"; } { 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 = "Nerd Fonts Cheatsheet"; url = "https://www.nerdfonts.com/cheat-sheet"; } { 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 = "Stylix Options"; url = "https://nix-community.github.io/stylix/options/modules/alacritty.html"; } { 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-tty; program = "pinentry"; }; }; }; targets.genericLinux.enable = true; }