1
0
Fork 0
nix-homemanager-laptop/home/home.nix

443 lines
12 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.nixd
pkgs.teams-for-linux # TODO: Move to flake in UTD folder
# pkgs.simplex-chat-desktop - not available on aarch64
pkgs.signal-desktop
pkgs.bitwarden-desktop # TODO: switch to rbw
pkgs.element-desktop # TODO: switch to programs.element-desktop
pkgs.logseq # TODO: switch to joplin-desktop
(config.lib.nixGL.wrap pkgs.kdePackages.audiotube)
pkgs.librewolf # TODO: switch to programs.librewolf
# pkgs.firefoxpwa - requires system access
# pkgs.widevine-cdm - doesn't work
# pkgs.firefox
pkgs.uutils-coreutils-noprefix
pkgs.uutils-diffutils
pkgs.uutils-findutils
pkgs.util-linux # TODO: switch to uutils when available
pkgs.iputils
pkgs.procps # TODO: switch to uutils when available
pkgs.procs
# pkgs.sudo-rs - TODO: should be used on NixOS
pkgs.psmisc
pkgs.dino
pkgs.julia
pkgs.telegram-desktop
pkgs.gzip
pkgs.gnutar
pkgs.iproute2
# pkgs.ncurses
pkgs.bzip3
pkgs.xz
pkgs.ladybird
pkgs.kdePackages.falkon
pkgs.curl
pkgs.wget
pkgs.mailutils
pkgs.lsof
pkgs.strace
pkgs.tcpdump
pkgs.file
pkgs.e2fsprogs
pkgs.speedtest-cli
pkgs.pijul
pkgs.lm_sensors
pkgs.libreoffice-fresh
pkgs.kdePackages.dolphin
pkgs.mupdf
pkgs.acpi
# pkgs.cacert - TODO: should be used on NixOS
# pkgs.cups - TODO: should be used on NixOS
# pkgs.languagetool - TODO: should be used on NixOS
# (config.lib.nixGL.wrap pkgs.firefox-devedition)
# pkgs.slacky - doesn't work, requires update
# pkgs.high-tide - doesn't work
# pkgs.tidal-hifi - aarch64 build broken
];
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"];
# };
# };
# TODO: Disable Guix integration
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 = {
# TODO: Add nixOS configuration bookmark, helix language and formatter, and languages.toml GitHub
# Add documentation for flake-parts for treefmt and pre-commit, and Vale supported languages, Harper supported languages
enable = true;
package = (config.lib.nixGL.wrap pkgs.floorp);
languagePacks = [
"eo"
"en"
];
profiles.main = {
# extensions = {
# packages = with pkgs.nur.repos.rycee.firefox-addons; [
# ublock-origin
# ];
# };
isDefault = true;
name = "Main";
settings = {
autoDisableScopes = 0;
};
bookmarks = {
force = true;
settings = [
{
name = "Comet Calendar";
url = "https://calendar.utdallas.edu/";
}
{
name = "UT Dallas Map";
url = "https://map.utdallas.edu/";
}
{
name = "eLearning";
url = "https://elearning.utdallas.edu/";
}
{
name = "DART Trip Planner";
url = "https://www.dart.org/trip/trip-planner/trip-planner-map";
}
{
name = "Guix Packages";
url = "https://toys.whereis.social/";
}
{
name = "Syncthing Docker";
url = "http://docker:8384/";
}
{
name = "Syncthing Local";
url = "http://localhost:8384/";
}
{
name = "NixOS Package Search";
url = "https://search.nixos.org/packages";
}
{
name = "TrueNAS";
url = "https://10.10.10.5:444/";
}
{
name = "Proxmox";
url = "https://gamingserver:8006";
}
{
name = "Portainer";
url = "http://docker:9000";
}
{
name = "ArchiveTeam Warrior";
url = "http://docker:8001/";
}
{
name = "The Indie Beat";
url = "https://theindiebeat.fm/";
}
{
name = "OpenRouter Chat";
url = "https://openrouter.ai/chat";
}
{
name = "Home Manager Configuration Options";
url = "https://nix-community.github.io/home-manager/options.xhtml";
}
];
};
};
};
};
services = {
arrpc.enable = true;
gpg-agent = {
enable = true;
enableSshSupport = true;
pinentry = {
package = pkgs.pinentry-all;
program = "pinentry";
};
};
};
targets.genericLinux.enable = true;
}