Compare commits

82 Commits

Author SHA1 Message Date
bb3305adbf chore: update llama-swap 2025-12-28 12:40:27 -05:00
9965ca8816 chore: better swap behavior 2025-12-28 12:02:31 -05:00
dce002cc24 chore: update llamacpp 2025-12-28 10:04:00 -05:00
ece872fdeb chore: update flake & llama-cpp 2025-12-26 21:38:46 -05:00
1c1f976186 chore: asahi flake 2025-12-26 20:55:10 -05:00
d40596d56f chore: up fsnotify on rke2 2025-12-26 20:51:59 -05:00
93edba05a9 chore: update model paths 2025-12-26 09:00:25 -05:00
9b1514243b chore: update nix-darwin to 25.11 and enable opencode 2025-12-21 15:22:51 -05:00
bf4e50a970 refactor: migrate from opencode to codecompanion with updated model configurations 2025-12-21 10:50:01 -05:00
a33790cfc7 feat: add opencode package and update models 2025-12-20 20:19:19 -05:00
c3aa7802ad feat(nvim): reorganize and modernize Neovim configuration
- Remove deprecated config files: git-ref.lua, git-signs.lua, diffview-config.lua, lsp-lines-config.lua, neotree-config.lua, fidget-spinner.lua, silicon-config.lua, telescope-config.lua, llm.lua
- Add new configuration files: diagnostics-config.lua, git-config.lua, llm-config.lua, snacks-config.lua
- Update existing config files: base.lua, dap-config.lua, init.lua, lsp-config.lua, lualine-config.lua, noice-config.lua, octo-config.lua, toggleterm-config.lua, which-key-config.lua
- Update nvim and opencode module configurations
2025-12-18 13:42:16 -05:00
b93249daf7 feat(llm): add Qwen3-VL-8B and Qwen2.5-Coder support, update CUDA config
- Add new `qwen3-8b-vision` model with multimodal support using mmproj file
- Add new `qwen2.5-coder-7b-instruct` model with FIM enabled via `--fim-qwen-7b-default`
- Update CUDA device usage from `CUDA0` to `CUDA1` for `olmoe-7b-instruct` and `phi-mini-8b-instruct`
- Upgrade llama.cpp to version 7426 with updated hash and CUDA architectures (61;86)
- Add Copilot acceptance shortcut `<C-J>` in insert mode and disable tab mapping
- Improve cache type settings across multiple models for better performance
2025-12-17 09:27:15 -05:00
e947e13a02 feat: comprehensive NixOS and home-manager configuration updates
This commit includes significant updates to the Nix configuration including:
- Added common NixOS module with system packages
- Updated home-manager configurations for various systems
- Enhanced terminal programs including Claude Code integration
- Updated LLM server configurations with new models
- Improved btop configuration with custom package
- Added opencode support with permission settings
- Updated tmux and nvim configurations

The changes introduce new features, update existing configurations, and improve the overall system setup.
2025-12-14 16:24:11 -05:00
80033fd2ae chore(release): bump NixOS to 25.11 and update channels
Upgrade the NixOS `stateVersion` from 25.05 to 25.11 in all system configuration files and update all nix channel URLs to the 25.11 releases. Adjust Home Manager and terminal module configurations accordingly, clean up duplicated SSH keys, and update LLaMA server command lines. Minor housekeeping changes to package definitions and other configuration files are also included.
2025-12-12 12:40:09 -05:00
a367f724ce feat: add opencode 2025-12-10 13:51:05 -05:00
c1a650a90e chore(llm): clean up models & fix llama-cpp issue 2025-12-10 12:12:50 -05:00
30934c8f7c switch llm endpoint 2025-12-06 08:55:48 -05:00
6dc1ee512e chore(llm): add vulkan support and update llama.cpp to 7278 2025-12-05 16:53:44 -05:00
d64cc0e47b feat(nvim): integrate CodeCompanion with LlamaSwap and Copilot
- Remove old code-companion-config.lua file
- Move LLM configuration to llm.lua with LlamaSwap and Copilot integration
- Add copilot-vim plugin to default.nix
- Update which-key bindings to include new CodeCompanion commands
- Configure CodeCompanion with chat, inline, and command strategies using LlamaSwap adapter
- Add memory configuration with default project files
- Update LSP configuration for CodeCompanion markdown rendering
2025-12-04 17:36:45 -05:00
50b03508e1 update llama-cpp 2025-12-03 21:07:13 -05:00
0ed577e815 more things 2025-12-03 11:40:01 -05:00
3089d6fdd1 chore: switch to qwen3 coder 30b FIM 2025-12-02 10:41:31 -05:00
8a5e2a9823 chore: llama-swap + fim 2025-12-02 09:47:35 -05:00
cf5fadf040 chore: add desktop 2025-12-01 21:09:44 -05:00
23a871a1c9 chore: upgrade 25.11 2025-11-30 19:35:10 -05:00
e804894036 fix: use nvtop for intel gpus 2025-11-20 17:00:00 -05:00
c60cb58d14 chore: native lsp 2025-11-15 16:04:57 -05:00
167c1d811c chore: update flake 2025-11-10 16:23:48 -05:00
bf9e3a044b fix: determinate nix + nix darwin 2025-11-08 11:32:50 -05:00
56921235b3 fix: actually fix user shell 2025-11-08 11:28:35 -05:00
b111cf4197 chore: remove csharp_ls 2025-11-08 11:19:44 -05:00
567e8c10d2 feat(nvim): add omnisharp 2025-11-06 09:26:34 -05:00
3480837c26 add: common tools 2025-11-04 21:02:25 -05:00
ad6de45681 add: strawberry 2025-11-03 08:58:33 -05:00
e7ee14a3c1 feat: add csharp lsp 2025-11-02 18:27:34 -05:00
667df4e8e6 fix: thinkpad sleep 2025-10-31 09:26:05 -04:00
5c429b8a6b block firefox ai crap 2025-10-28 08:41:12 -04:00
4f054051e5 fix: thinkpad L14 S4 hibernate 2025-10-25 13:02:36 -04:00
318c6f6984 asahi update 2025-10-22 10:19:21 -04:00
0c2bf58cfa fix: prevent clangd from formatting proto files 2025-10-15 10:36:09 -04:00
70df72a6f5 fix: incorrect bash shell in toggleterm 2025-10-10 14:24:22 -04:00
8c417d8e56 add aws stuff 2025-10-10 10:29:17 -04:00
7ce476adb3 update libvirt & add clangd lsp 2025-10-03 13:10:09 -04:00
e173ddffc9 fix tmux over mosh copy & boot config 2025-10-01 17:55:44 -04:00
eb0c28d2f0 add qemu & battery notifs 2025-09-29 20:37:53 -04:00
2a40dc791d more 2025-09-28 18:32:02 -04:00
1098c68073 wip 2025-09-27 12:28:43 -04:00
74e6684783 add ssh key 2025-09-23 20:32:31 -04:00
5b05dffb20 enable ts 2025-09-23 20:31:07 -04:00
1d9517a37f enable mosh 2025-09-23 19:23:35 -04:00
ff62814436 update nameserver 2025-09-23 16:18:43 -04:00
be5c3e9cb8 tmux 2025-09-23 15:44:57 -04:00
bf4148dab0 split bash from ghostty 2025-09-22 19:05:18 -04:00
fbb274a50a more systems 2025-09-19 14:37:17 -04:00
9159465836 add headscale specific node 2025-09-16 16:30:56 -04:00
cff9bcaecc alias 2025-09-07 21:03:27 -04:00
2492bb8825 tailscale 2025-09-07 15:20:47 -04:00
788697561a add kubectl 2025-09-06 20:33:36 -04:00
f6dbe8ad1d mkopt systemd vs grub 2025-09-06 09:47:27 -04:00
26f32d3225 chore: added llama-cpp and migrate office 2025-09-05 22:58:00 -04:00
9433abcaf4 update nix flake, remote nix-anywhere, update readme 2025-09-03 08:12:35 -04:00
f5c4e6c9db back to vmware 2025-09-01 20:51:48 -04:00
b970f6f550 add cloud 2025-09-01 20:09:23 -04:00
93b7c6ee25 update nix 2025-09-01 15:10:31 -04:00
cc045f225b feat(nvim): add octo 2025-08-28 17:04:54 -04:00
e63dd8d5d1 add: remmina & thinkpad hardware mod 2025-07-28 16:55:28 -04:00
6b42b3cc22 vim deprecated functions 2025-07-27 18:22:11 -04:00
73b9bf063e update 25.05 2025-07-27 18:17:35 -04:00
dea1fc8790 chore: update vim stuff 2025-07-27 18:09:57 -04:00
57dbafb5a4 update 24.11 2025-07-27 17:57:35 -04:00
5bb653f561 add bt to tp 2025-07-27 17:49:29 -04:00
f09e2a9ec1 chore: nvim autopep8 line limit 2025-07-23 20:21:10 -04:00
6cd0437fb5 feat: add wireshark 2025-07-23 11:17:48 -04:00
d6c908dc70 git signs tweak 2025-06-09 13:22:03 -04:00
b1981a2dcc autopep8 2025-05-01 14:06:05 -04:00
a58d02d1bd nvim: use pyright for starlark 2025-04-30 13:12:00 -04:00
c2af87fce5 add telescope undo tree 2025-04-22 19:11:08 -04:00
93d50641c1 macos update instructions 2025-04-22 11:47:10 -04:00
a6a9a97650 add pin hyprland bind 2025-04-22 07:46:05 -04:00
5455230930 add gimp 2025-04-20 21:16:56 -04:00
b632c0c3af sync system clipboard 2025-04-20 21:10:15 -04:00
cf0fa75058 Migrate to Snowfall (#1)
Reviewed-on: #1
Co-authored-by: Evan Reichard <evan@reichard.io>
Co-committed-by: Evan Reichard <evan@reichard.io>
2025-04-21 00:56:53 +00:00
105 changed files with 3542 additions and 1100 deletions

1
.envrc Normal file
View File

@@ -0,0 +1 @@
use flake

View File

@@ -3,6 +3,8 @@ keys:
- &admin_reichard age1sac93wpnjcv62s7583jv6a4yspndh6k0r25g3qx3k7gq748uvafst6nz4w - &admin_reichard age1sac93wpnjcv62s7583jv6a4yspndh6k0r25g3qx3k7gq748uvafst6nz4w
# lin-va-mbp-personal@evanreichard - SSH Derived # lin-va-mbp-personal@evanreichard - SSH Derived
- &user_lin-va-mbp-personal age17ayje4uv2mhwehhp9jr3u9l0ds07396kt7ef40sufx89vm7cgfjq6d5d4y - &user_lin-va-mbp-personal age17ayje4uv2mhwehhp9jr3u9l0ds07396kt7ef40sufx89vm7cgfjq6d5d4y
# mac-va-mbp-personal@evanreichard - SSH Derived
- &user_mac-va-mbp-personal age1dccte7xtwswgef089nd80dutp96xnezx5lrqnneh9cusegsnda8sj3dj6c
creation_rules: creation_rules:
- path_regex: secrets/[^/]+\.(yaml|json|env|ini)$ - path_regex: secrets/[^/]+\.(yaml|json|env|ini)$
key_groups: key_groups:
@@ -13,3 +15,8 @@ creation_rules:
- age: - age:
- *admin_reichard - *admin_reichard
- *user_lin-va-mbp-personal - *user_lin-va-mbp-personal
- path_regex: secrets/mac-va-mbp-personal/evanreichard/[^/]+\.(yaml|json|env|ini)$
key_groups:
- age:
- *admin_reichard
- *user_mac-va-mbp-personal

View File

@@ -2,65 +2,79 @@
This repository contains the configuration for multiple machines, as well as my home / IDE config (home-manager). This repository contains the configuration for multiple machines, as well as my home / IDE config (home-manager).
### NixOS ```bash
# Install NixOS
./bootstrap.sh install --name lin-va-nix-builder
# Remote Image Build (NixOS Builder)
./bootstrap.sh image --name lin-va-rke2 --remote
# Home Manager Install
home-manager switch --flake .#evanreichard@mac-va-mbp-personal
# Update Flake
nix flake update
```
## Manual
```bash ```bash
# Install NixOS
sudo nixos-rebuild switch --flake .#lin-va-mbp-personal sudo nixos-rebuild switch --flake .#lin-va-mbp-personal
# Install NixOS (Remote)
nix run github:nix-community/nixos-anywhere -- --flake .#lin-cloud-kube1 --target-host \<USER\>@\<IP\>
# Build Image
nix build .#vmwareConfigurations.lin-va-rke2
``` ```
### NixOS Generators ## Nix Darwin
```bash ```bash
nix build .#vmwareConfigurations.rke2-node # Install Nix Without Determinate
curl --proto '=https' --tlsv1.2 -sSf -L https://install.determinate.systems/nix | sh -s -- install
# Switch Nix Darwin
sudo nix run nix-darwin#darwin-rebuild -- switch --flake .#mac-va-mbp-personal
sudo darwin-rebuild switch --flake .#mac-va-mbp-personal
``` ```
### Home Manager ## Clean Garbage
NOTE: This will remove previous generations
```bash ```bash
home-manager switch --flake .#evanreichard@MBP-Personal sudo nix-collect-garbage --delete-old
nix-collect-garbage --delete-old
``` ```
### NixOS Hosts ## Home Manager
#### Copy Config
```bash ```bash
rsync -av --exclude='.git' . root@HOST:/etc/nixos # Update System Channels
sudo nix-channel --add https://nixos.org/channels/nixpkgs-25.11-darwin nixpkgs
sudo nix-channel --update
# Update Home Manager
nix-channel --add https://github.com/nix-community/home-manager/archive/release-25.11.tar.gz home-manager
nix-channel --update
# Link Repo
ln -s /Users/evanreichard/Development/git/personal/nix/home-manager ~/.config/home-manager
# Build Home Manager
home-manager switch
``` ```
#### Partition Drives ### OS Update
`/etc/bashrc` may get overridden. To properly load Nix, prepend the following:
```bash ```bash
# Validate Disk # Nix
ls -l /dev/disk/by-id if [ -e '/nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh' ]; then
. '/nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh'
# Partition Disk fi
# WARNING: This will destroy all data on the disk(s) # End Nix
sudo nix \
--experimental-features "nix-command flakes" \
run github:nix-community/disko -- \
--mode disko \
--flake /etc/nixos#HOST_CONFIG
```
#### Install NixOS
```bash
# Install
sudo nixos-install --flake /etc/nixos#HOST_CONFIG
# Reboot
sudo reboot
```
#### Copy Config Back to Host
```bash
rsync -av --exclude='.git' . root@HOST:/etc/nixos
```
#### Rebuild NixOS
```bash
sudo nixos-rebuild switch
``` ```

View File

@@ -31,13 +31,13 @@ function cmd_image() {
# Validate Config Exists # Validate Config Exists
if ! nix eval --json --impure \ if ! nix eval --json --impure \
".#qcowConfigurations" \ ".#vmwareConfigurations" \
--apply "s: builtins.hasAttr \"$name\" s" 2>/dev/null | grep -q "true"; then --apply "s: builtins.hasAttr \"$name\" s" 2>/dev/null | grep -q "true"; then
echo "Error: NixOS Generator Config '$name' not found" echo "Error: NixOS Generator Config '$name' not found"
exit 1 exit 1
fi fi
build_args=(".#qcowConfigurations.$name") build_args=(".#vmwareConfigurations.$name")
if [ "$remote" = true ]; then if [ "$remote" = true ]; then
build_args+=("-j0") build_args+=("-j0")
fi fi
@@ -51,8 +51,9 @@ function cmd_image() {
} }
function cmd_install() { function cmd_install() {
local usage="Usage: $0 install --name <system-name>" local usage="Usage: $0 install --name <system-name> [--remote <user@remote-host>]"
local name="" local name=""
local remote=""
while [[ $# -gt 0 ]]; do while [[ $# -gt 0 ]]; do
case "$1" in case "$1" in
@@ -60,6 +61,10 @@ function cmd_install() {
name="$2" name="$2"
shift 2 shift 2
;; ;;
--remote)
remote="$2"
shift 2
;;
*) *)
echo "$usage" echo "$usage"
exit 1 exit 1
@@ -87,6 +92,18 @@ function cmd_install() {
exit 1 exit 1
fi fi
# Remote or Local
if [ -n "$remote" ]; then
cmd_install_remote "$name" "$remote"
else
cmd_install_local "$name" "$disk_id"
fi
}
function cmd_install_local(){
local name="$1"
local disk_id="$2"
# Validate Disk Exists # Validate Disk Exists
if [ ! -e "$disk_id" ]; then if [ ! -e "$disk_id" ]; then
echo "Error: Disk $disk_id not found on system" echo "Error: Disk $disk_id not found on system"
@@ -133,6 +150,27 @@ function cmd_install() {
sudo reboot sudo reboot
} }
function cmd_install_remote(){
local name="$1"
local remote="$2"
# Prompt Install
read -p "This will completely wipe and install NixOS on $remote with configuration $name. Continue? (y/n) " -n 1 -r
echo
if [[ ! $REPLY =~ ^[Yy]$ ]]; then
echo "Operation Cancelled"
exit 1
fi
# Install NixOS
echo "Installing $name to remote host: $remote"
if ! nix run github:nix-community/nixos-anywhere -- --flake ".#$name" --target-host "$remote"; then
echo "Error: Remote NixOS installation failed"
exit 1
fi
echo "Successfully installed $name to remote host: $remote"
}
case "$1" in case "$1" in
image) image)
shift shift

166
flake.lock generated
View File

@@ -5,34 +5,53 @@
"flake-compat": "flake-compat", "flake-compat": "flake-compat",
"nixpkgs": [ "nixpkgs": [
"nixpkgs" "nixpkgs"
], ]
"rust-overlay": "rust-overlay"
}, },
"locked": { "locked": {
"lastModified": 1738646032, "lastModified": 1766064315,
"narHash": "sha256-57BdBE9anNpIpf48EiTVLGxg4mOQ04XjHCEP0gLTsFA=", "narHash": "sha256-aMoYLYIj+yYGhDKuSromj+VZYnMyN3lRRAZ+dk1IOiE=",
"owner": "tpwrules", "owner": "tpwrules",
"repo": "nixos-apple-silicon", "repo": "nixos-apple-silicon",
"rev": "e77031211944723a38bebc043e48847c36e43668", "rev": "f94f4496775f9ca6e8a9e9e83f5aa4e4210fbb5d",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "tpwrules", "owner": "tpwrules",
"ref": "releasep2-2024-12-25",
"repo": "nixos-apple-silicon", "repo": "nixos-apple-silicon",
"type": "github" "type": "github"
} }
}, },
"darwin": {
"inputs": {
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1765066094,
"narHash": "sha256-0YSU35gfRFJzx/lTGgOt6ubP8K6LeW0vaywzNNqxkl4=",
"owner": "nix-darwin",
"repo": "nix-darwin",
"rev": "688427b1aab9afb478ca07989dc754fa543e03d5",
"type": "github"
},
"original": {
"owner": "nix-darwin",
"ref": "nix-darwin-25.11",
"repo": "nix-darwin",
"type": "github"
}
},
"disko": { "disko": {
"inputs": { "inputs": {
"nixpkgs": "nixpkgs" "nixpkgs": "nixpkgs"
}, },
"locked": { "locked": {
"lastModified": 1743598667, "lastModified": 1766150702,
"narHash": "sha256-ViE7NoFWytYO2uJONTAX35eGsvTYXNHjWALeHAg8OQY=", "narHash": "sha256-P0kM+5o+DKnB6raXgFEk3azw8Wqg5FL6wyl9jD+G5a4=",
"owner": "nix-community", "owner": "nix-community",
"repo": "disko", "repo": "disko",
"rev": "329d3d7e8bc63dd30c39e14e6076db590a6eabe6", "rev": "916506443ecd0d0b4a0f4cf9d40a3c22ce39b378",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -43,18 +62,17 @@
}, },
"firefox-addons": { "firefox-addons": {
"inputs": { "inputs": {
"flake-utils": "flake-utils",
"nixpkgs": [ "nixpkgs": [
"nixpkgs" "nixpkgs"
] ]
}, },
"locked": { "locked": {
"dir": "pkgs/firefox-addons", "dir": "pkgs/firefox-addons",
"lastModified": 1743861198, "lastModified": 1766762570,
"narHash": "sha256-PzbPHoSI5U1juWd01Spf3ST7ylR9mQ84v5p7NksBplY=", "narHash": "sha256-Nevsj5NYurwp3I6nSMeh3uirwoinVSbCldqOXu4smms=",
"owner": "rycee", "owner": "rycee",
"repo": "nur-expressions", "repo": "nur-expressions",
"rev": "7408ed5bbc9009741094f4dd4cc1abec79e79e7e", "rev": "03d7d310ea91d6e4b47ed70aa86c781fcc5b38e1",
"type": "gitlab" "type": "gitlab"
}, },
"original": { "original": {
@@ -66,11 +84,11 @@
}, },
"flake-compat": { "flake-compat": {
"locked": { "locked": {
"lastModified": 1688025799, "lastModified": 1746162366,
"narHash": "sha256-ktpB4dRtnksm9F5WawoIkEneh1nrEvuxb5lJFt1iOyw=", "narHash": "sha256-5SSSZ/oQkwfcAz/o/6TlejlVGqeK08wyREBQ5qFFPhM=",
"owner": "nix-community", "owner": "nix-community",
"repo": "flake-compat", "repo": "flake-compat",
"rev": "8bf105319d44f6b9f0d764efa4fdef9f1cc9ba1c", "rev": "0f158086a2ecdbb138cd0429410e44994f1b7e4b",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -96,40 +114,6 @@
} }
}, },
"flake-utils": { "flake-utils": {
"locked": {
"lastModified": 1629284811,
"narHash": "sha256-JHgasjPR0/J1J3DRm4KxM4zTyAj4IOJY8vIl75v/kPI=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "c5d161cc0af116a2e17f54316f0bf43f0819785c",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"flake-utils-plus": {
"inputs": {
"flake-utils": "flake-utils_2"
},
"locked": {
"lastModified": 1715533576,
"narHash": "sha256-fT4ppWeCJ0uR300EH3i7kmgRZnAVxrH+XtK09jQWihk=",
"owner": "gytis-ivaskevicius",
"repo": "flake-utils-plus",
"rev": "3542fe9126dc492e53ddd252bb0260fe035f2c0f",
"type": "github"
},
"original": {
"owner": "gytis-ivaskevicius",
"repo": "flake-utils-plus",
"rev": "3542fe9126dc492e53ddd252bb0260fe035f2c0f",
"type": "github"
}
},
"flake-utils_2": {
"inputs": { "inputs": {
"systems": "systems" "systems": "systems"
}, },
@@ -147,6 +131,25 @@
"type": "github" "type": "github"
} }
}, },
"flake-utils-plus": {
"inputs": {
"flake-utils": "flake-utils"
},
"locked": {
"lastModified": 1715533576,
"narHash": "sha256-fT4ppWeCJ0uR300EH3i7kmgRZnAVxrH+XtK09jQWihk=",
"owner": "gytis-ivaskevicius",
"repo": "flake-utils-plus",
"rev": "3542fe9126dc492e53ddd252bb0260fe035f2c0f",
"type": "github"
},
"original": {
"owner": "gytis-ivaskevicius",
"repo": "flake-utils-plus",
"rev": "3542fe9126dc492e53ddd252bb0260fe035f2c0f",
"type": "github"
}
},
"home-manager": { "home-manager": {
"inputs": { "inputs": {
"nixpkgs": [ "nixpkgs": [
@@ -154,16 +157,16 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1743808813, "lastModified": 1766553861,
"narHash": "sha256-2lDQBOmlz9ggPxcS7/GvcVdzXMIiT+PpMao6FbLJSr0=", "narHash": "sha256-ZbnG01yA3O8Yr1vUm3+NQ2qk9iRhS5bloAnuXHHy7+c=",
"owner": "nix-community", "owner": "nix-community",
"repo": "home-manager", "repo": "home-manager",
"rev": "a9f8b3db211b4609ddd83683f9db89796c7f6ac6", "rev": "0999ed8f965bbbd991437ad9c5ed3434cecbc30e",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "nix-community", "owner": "nix-community",
"ref": "release-24.11", "ref": "release-25.11",
"repo": "home-manager", "repo": "home-manager",
"type": "github" "type": "github"
} }
@@ -191,11 +194,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1742568034, "lastModified": 1764234087,
"narHash": "sha256-QaMEhcnscfF2MqB7flZr+sLJMMYZPnvqO4NYf9B4G38=", "narHash": "sha256-NHF7QWa0ZPT8hsJrvijREW3+nifmF2rTXgS2v0tpcEA=",
"owner": "nix-community", "owner": "nix-community",
"repo": "nixos-generators", "repo": "nixos-generators",
"rev": "42ee229088490e3777ed7d1162cb9e9d8c3dbb11", "rev": "032a1878682fafe829edfcf5fdfad635a2efe748",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -206,11 +209,11 @@
}, },
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1743259260, "lastModified": 1763618868,
"narHash": "sha256-ArWLUgRm1tKHiqlhnymyVqi5kLNCK5ghvm06mfCl4QY=", "narHash": "sha256-v5afmLjn/uyD9EQuPBn7nZuaZVV9r+JerayK/4wvdWA=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "eb0e0f21f15c559d2ac7633dc81d079d1caf5f5f", "rev": "a8d610af3f1a5fb71e23e08434d8d61a466fc942",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -222,11 +225,11 @@
}, },
"nixpkgs-unstable": { "nixpkgs-unstable": {
"locked": { "locked": {
"lastModified": 1744098102, "lastModified": 1766651565,
"narHash": "sha256-tzCdyIJj9AjysC3OuKA+tMD/kDEDAF9mICPDU7ix0JA=", "narHash": "sha256-QEhk0eXgyIqTpJ/ehZKg9IKS7EtlWxF3N7DXy42zPfU=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "c8cd81426f45942bb2906d5ed2fe21d2f19d95b7", "rev": "3e2499d5539c16d0d173ba53552a4ff8547f4539",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -238,16 +241,16 @@
}, },
"nixpkgs_2": { "nixpkgs_2": {
"locked": { "locked": {
"lastModified": 1743813633, "lastModified": 1766736597,
"narHash": "sha256-BgkBz4NpV6Kg8XF7cmHDHRVGZYnKbvG0Y4p+jElwxaM=", "narHash": "sha256-BASnpCLodmgiVn0M1MU2Pqyoz0aHwar/0qLkp7CjvSQ=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "7819a0d29d1dd2bc331bec4b327f0776359b1fa6", "rev": "f560ccec6b1116b22e6ed15f4c510997d99d5852",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "NixOS", "owner": "NixOS",
"ref": "nixos-24.11", "ref": "nixos-25.11",
"repo": "nixpkgs", "repo": "nixpkgs",
"type": "github" "type": "github"
} }
@@ -255,6 +258,7 @@
"root": { "root": {
"inputs": { "inputs": {
"apple-silicon": "apple-silicon", "apple-silicon": "apple-silicon",
"darwin": "darwin",
"disko": "disko", "disko": "disko",
"firefox-addons": "firefox-addons", "firefox-addons": "firefox-addons",
"home-manager": "home-manager", "home-manager": "home-manager",
@@ -265,22 +269,6 @@
"sops-nix": "sops-nix" "sops-nix": "sops-nix"
} }
}, },
"rust-overlay": {
"flake": false,
"locked": {
"lastModified": 1686795910,
"narHash": "sha256-jDa40qRZ0GRQtP9EMZdf+uCbvzuLnJglTUI2JoHfWDc=",
"owner": "oxalica",
"repo": "rust-overlay",
"rev": "5c2b97c0a9bc5217fc3dfb1555aae0fb756d99f9",
"type": "github"
},
"original": {
"owner": "oxalica",
"repo": "rust-overlay",
"type": "github"
}
},
"snowfall-lib": { "snowfall-lib": {
"inputs": { "inputs": {
"flake-compat": "flake-compat_2", "flake-compat": "flake-compat_2",
@@ -290,11 +278,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1736130495, "lastModified": 1765361626,
"narHash": "sha256-4i9nAJEZFv7vZMmrE0YG55I3Ggrtfo5/T07JEpEZ/RM=", "narHash": "sha256-kX0Dp/kYSRbQ+yd9e3lmmUWdNbipufvKfL2IzbrSpnY=",
"owner": "snowfallorg", "owner": "snowfallorg",
"repo": "lib", "repo": "lib",
"rev": "02d941739f98a09e81f3d2d9b3ab08918958beac", "rev": "c566ad8b7352c30ec3763435de7c8f1c46ebb357",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -310,11 +298,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1743910657, "lastModified": 1766289575,
"narHash": "sha256-zr2jmWeWyhCD8WmO2aWov2g0WPPuZfcJDKzMJZYGq3Y=", "narHash": "sha256-BOKCwOQQIP4p9z8DasT5r+qjri3x7sPCOq+FTjY8Z+o=",
"owner": "Mic92", "owner": "Mic92",
"repo": "sops-nix", "repo": "sops-nix",
"rev": "523f58a4faff6c67f5f685bed33a7721e984c304", "rev": "9836912e37aef546029e48c8749834735a6b9dad",
"type": "github" "type": "github"
}, },
"original": { "original": {

View File

@@ -2,7 +2,7 @@
description = "NixOS Hosts"; description = "NixOS Hosts";
inputs = { inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.11"; nixpkgs.url = "github:NixOS/nixpkgs/nixos-25.11";
nixpkgs-unstable.url = "github:NixOS/nixpkgs/nixos-unstable"; nixpkgs-unstable.url = "github:NixOS/nixpkgs/nixos-unstable";
disko.url = "github:nix-community/disko"; disko.url = "github:nix-community/disko";
snowfall-lib = { snowfall-lib = {
@@ -10,11 +10,11 @@
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
}; };
home-manager = { home-manager = {
url = "github:nix-community/home-manager/release-24.11"; url = "github:nix-community/home-manager/release-25.11";
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
}; };
apple-silicon = { apple-silicon = {
url = "github:tpwrules/nixos-apple-silicon/releasep2-2024-12-25"; url = "github:tpwrules/nixos-apple-silicon";
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
}; };
nixos-generators = { nixos-generators = {
@@ -29,9 +29,14 @@
url = "github:Mic92/sops-nix"; url = "github:Mic92/sops-nix";
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
}; };
darwin = {
url = "github:nix-darwin/nix-darwin/nix-darwin-25.11";
inputs.nixpkgs.follows = "nixpkgs";
};
}; };
outputs = inputs: outputs =
inputs:
inputs.snowfall-lib.mkFlake { inputs.snowfall-lib.mkFlake {
inherit inputs; inherit inputs;
src = ./.; src = ./.;
@@ -51,6 +56,12 @@
]; ];
}; };
outputs-builder = channels: {
devShells = {
default = import ./shells/default/default.nix { pkgs = channels.nixpkgs; };
};
};
homes.modules = with inputs; [ homes.modules = with inputs; [
sops-nix.homeManagerModules.sops sops-nix.homeManagerModules.sops
]; ];
@@ -59,6 +70,11 @@
nixos = with inputs; [ nixos = with inputs; [
disko.nixosModules.disko disko.nixosModules.disko
sops-nix.nixosModules.sops sops-nix.nixosModules.sops
./modules/nixos/common
];
darwin = with inputs; [
home-manager.darwinModules.home-manager
sops-nix.darwinModules.sops
]; ];
}; };
}; };

View File

@@ -1,9 +1,13 @@
{ lib, config, namespace, ... }: { lib
, config
, namespace
, ...
}:
let let
inherit (lib.${namespace}) enabled; inherit (lib.${namespace}) enabled;
in in
{ {
home.stateVersion = "24.11"; home.stateVersion = "25.11";
reichard = { reichard = {
user = { user = {
@@ -11,15 +15,6 @@ in
inherit (config.snowfallorg.user) name; inherit (config.snowfallorg.user) name;
}; };
services = {
# TODO
# sops = {
# enable = true;
# defaultSopsFile = lib.snowfall.fs.get-file "secrets/mac-va-mbp-personal/evanreichard/default.yaml";
# sshKeyPaths = [ "${config.home.homeDirectory}/.ssh/id_ed25519" ];
# };
};
programs = { programs = {
graphical = { graphical = {
ghostty = enabled; ghostty = enabled;
@@ -32,26 +27,8 @@ in
git = enabled; git = enabled;
k9s = enabled; k9s = enabled;
nvim = enabled; nvim = enabled;
opencode = enabled;
}; };
}; };
}; };
# Global Packages
# programs.jq = enabled;
# programs.pandoc = enabled;
# home.packages = with pkgs; [
# android-tools
# imagemagick
# mosh
# python311
# texliveSmall # Pandoc PDF Dep
# google-cloud-sdk
# tldr
# ];
# SQLite Configuration
home.file.".sqliterc".text = ''
.headers on
.mode column
'';
} }

View File

@@ -1,9 +1,14 @@
{ pkgs, lib, config, namespace, ... }: { pkgs
, lib
, config
, namespace
, ...
}:
let let
inherit (lib.${namespace}) enabled; inherit (lib.${namespace}) enabled;
in in
{ {
home.stateVersion = "24.11"; home.stateVersion = "25.11";
reichard = { reichard = {
user = { user = {
@@ -11,27 +16,20 @@ in
inherit (config.snowfallorg.user) name; inherit (config.snowfallorg.user) name;
}; };
services = {
# TODO
# sops = {
# enable = true;
# defaultSopsFile = lib.snowfall.fs.get-file "secrets/mac-va-mbp-work/evanreichard/default.yaml";
# sshKeyPaths = [ "${config.home.homeDirectory}/.ssh/id_ed25519" ];
# };
};
programs = { programs = {
graphical = { graphical = {
ghostty = enabled; ghostty = enabled;
}; };
terminal = { terminal = {
aws = enabled;
btop = enabled; btop = enabled;
claude-code = enabled;
direnv = enabled; direnv = enabled;
git = enabled; git = enabled;
k9s = enabled; k9s = enabled;
nvim = enabled; nvim = enabled;
aws = enabled; opencode = enabled;
}; };
}; };
}; };
@@ -40,18 +38,9 @@ in
programs.jq = enabled; programs.jq = enabled;
programs.pandoc = enabled; programs.pandoc = enabled;
home.packages = with pkgs; [ home.packages = with pkgs; [
android-tools colima
imagemagick docker
mosh reichard.qwen-code
python311 codex
texliveSmall # Pandoc PDF Dep
google-cloud-sdk
tldr
]; ];
# SQLite Configuration
home.file.".sqliterc".text = ''
.headers on
.mode column
'';
} }

View File

@@ -1,9 +1,15 @@
{ pkgs, lib, config, namespace, osConfig, ... }: { pkgs
, lib
, config
, namespace
, osConfig
, ...
}:
let let
inherit (lib.${namespace}) enabled; inherit (lib.${namespace}) enabled;
in in
{ {
home.stateVersion = "24.11"; home.stateVersion = "25.11";
reichard = { reichard = {
user = { user = {
@@ -49,25 +55,16 @@ in
}; };
}; };
# home.packages = with pkgs; [
# catppuccin-gtk
# ];
dconf = { dconf = {
settings = { settings = {
"org/gnome/desktop/interface" = { "org/gnome/desktop/interface" = {
color-scheme = "prefer-dark"; color-scheme = "prefer-dark";
cursor-theme = "catppuccin-macchiato-mauve-cursors"; cursor-theme = "catppuccin-macchiato-mauve-cursors";
cursor-size = 24; cursor-size = 24;
# enable-hot-corners = false;
# font-name = osConfig.${namespace}.system.fonts.default;
# gtk-theme = cfg.theme.name;
# icon-theme = cfg.icon.name;
}; };
}; };
}; };
home.pointerCursor = { home.pointerCursor = {
gtk.enable = true; gtk.enable = true;
name = "catppuccin-macchiato-mauve-cursors"; name = "catppuccin-macchiato-mauve-cursors";
@@ -81,23 +78,4 @@ in
path = "${config.home.homeDirectory}/.kube/rke2"; path = "${config.home.homeDirectory}/.kube/rke2";
}; };
}; };
# Global Packages
# programs.jq = enabled;
# programs.pandoc = enabled;
# home.packages = with pkgs; [
# android-tools
# imagemagick
# mosh
# python311
# texliveSmall # Pandoc PDF Dep
# google-cloud-sdk
# tldr
# ];
# SQLite Configuration
home.file.".sqliterc".text = ''
.headers on
.mode column
'';
} }

View File

@@ -0,0 +1,31 @@
{ lib
, config
, namespace
, ...
}:
let
inherit (lib.${namespace}) enabled;
in
{
home.stateVersion = "25.11";
reichard = {
user = {
enable = true;
inherit (config.snowfallorg.user) name;
};
services = {
ssh-agent = enabled;
};
programs = {
terminal = {
bash = enabled;
btop = enabled;
direnv = enabled;
tmux = enabled;
};
};
};
}

View File

@@ -0,0 +1,36 @@
{ lib
, config
, namespace
, ...
}:
let
inherit (lib.${namespace}) enabled;
in
{
home.stateVersion = "25.11";
reichard = {
user = {
enable = true;
inherit (config.snowfallorg.user) name;
};
services = {
ssh-agent = enabled;
};
programs = {
terminal = {
bash = enabled;
btop = enabled;
claude-code = enabled;
direnv = enabled;
git = enabled;
k9s = enabled;
nvim = enabled;
opencode = enabled;
tmux = enabled;
};
};
};
}

View File

@@ -1,9 +1,15 @@
{ pkgs, lib, config, namespace, osConfig, ... }: { pkgs
, lib
, config
, namespace
, osConfig
, ...
}:
let let
inherit (lib.${namespace}) enabled; inherit (lib.${namespace}) enabled;
in in
{ {
home.stateVersion = "24.11"; home.stateVersion = "25.11";
reichard = { reichard = {
user = { user = {
@@ -15,6 +21,7 @@ in
ssh-agent = enabled; ssh-agent = enabled;
fusuma = enabled; fusuma = enabled;
swww = enabled; swww = enabled;
poweralertd = enabled;
sops = { sops = {
enable = true; enable = true;
defaultSopsFile = lib.snowfall.fs.get-file "secrets/default.yaml"; defaultSopsFile = lib.snowfall.fs.get-file "secrets/default.yaml";
@@ -26,7 +33,11 @@ in
graphical = { graphical = {
wms.hyprland = enabled; wms.hyprland = enabled;
ghostty = enabled; ghostty = enabled;
strawberry = enabled;
gimp = enabled;
wireshark = enabled;
ghidra = enabled; ghidra = enabled;
remmina = enabled;
browsers.firefox = { browsers.firefox = {
enable = true; enable = true;
gpuAcceleration = true; gpuAcceleration = true;
@@ -44,25 +55,16 @@ in
}; };
}; };
# home.packages = with pkgs; [
# catppuccin-gtk
# ];
dconf = { dconf = {
settings = { settings = {
"org/gnome/desktop/interface" = { "org/gnome/desktop/interface" = {
color-scheme = "prefer-dark"; color-scheme = "prefer-dark";
cursor-theme = "catppuccin-macchiato-mauve-cursors"; cursor-theme = "catppuccin-macchiato-mauve-cursors";
cursor-size = 24; cursor-size = 24;
# enable-hot-corners = false;
# font-name = osConfig.${namespace}.system.fonts.default;
# gtk-theme = cfg.theme.name;
# icon-theme = cfg.icon.name;
}; };
}; };
}; };
home.pointerCursor = { home.pointerCursor = {
gtk.enable = true; gtk.enable = true;
name = "catppuccin-macchiato-mauve-cursors"; name = "catppuccin-macchiato-mauve-cursors";
@@ -76,10 +78,4 @@ in
path = "${config.home.homeDirectory}/.kube/rke2"; path = "${config.home.homeDirectory}/.kube/rke2";
}; };
}; };
# SQLite Configuration
home.file.".sqliterc".text = ''
.headers on
.mode column
'';
} }

View File

@@ -1,4 +1,10 @@
{ pkgs, lib, config, namespace, osConfig, ... }: { pkgs
, lib
, config
, namespace
, osConfig
, ...
}:
let let
inherit (lib.${namespace}) enabled; inherit (lib.${namespace}) enabled;
in in
@@ -62,7 +68,6 @@ in
}; };
}; };
home.pointerCursor = { home.pointerCursor = {
gtk.enable = true; gtk.enable = true;
name = "catppuccin-macchiato-mauve-cursors"; name = "catppuccin-macchiato-mauve-cursors";
@@ -76,23 +81,4 @@ in
path = "${config.home.homeDirectory}/.kube/rke2"; path = "${config.home.homeDirectory}/.kube/rke2";
}; };
}; };
# Global Packages
# programs.jq = enabled;
# programs.pandoc = enabled;
# home.packages = with pkgs; [
# android-tools
# imagemagick
# mosh
# python311
# texliveSmall # Pandoc PDF Dep
# google-cloud-sdk
# tldr
# ];
# SQLite Configuration
home.file.".sqliterc".text = ''
.headers on
.mode column
'';
} }

View File

@@ -0,0 +1,8 @@
{
config = {
home-manager = {
useGlobalPkgs = true;
useUserPackages = true;
};
};
}

View File

@@ -0,0 +1,103 @@
{ config, lib, pkgs, inputs, namespace, host, ... }:
let
inherit (lib) types mkIf;
inherit (lib.${namespace}) mkBoolOpt mkOpt;
cfg = config.${namespace}.nix;
in
{
options.${namespace}.nix = {
enable = mkBoolOpt true "Whether or not to manage nix configuration.";
usingDeterminate = mkBoolOpt false "Whether we're using determinate nix";
package = mkOpt types.package pkgs.nixVersions.latest "Which nix package to use.";
};
config = mkIf cfg.enable {
nix =
let
mappedRegistry = lib.pipe inputs [
(lib.filterAttrs (_: lib.isType "flake"))
(lib.mapAttrs (_: flake: { inherit flake; }))
(x: x // {
nixpkgs.flake = if pkgs.stdenv.hostPlatform.isLinux then inputs.nixpkgs else inputs.nixpkgs-unstable;
})
(x: if pkgs.stdenv.hostPlatform.isDarwin then lib.removeAttrs x [ "nixpkgs-unstable" ] else x)
];
users = [
"root"
"@wheel"
"nix-builder"
"evanreichard"
];
in
{
inherit (cfg) package;
buildMachines = lib.optional (config.${namespace}.security.sops.enable && host != "nixos-builder") {
hostName = "10.0.50.130";
systems = [ "x86_64-linux" ];
sshUser = "evanreichard";
protocol = "ssh";
sshKey = config.sops.secrets.builder_ssh_key.path;
supportedFeatures = [
"benchmark"
"big-parallel"
"nixos-test"
"kvm"
];
};
checkConfig = true;
distributedBuilds = true;
optimise.automatic = !cfg.usingDeterminate;
registry = lib.mkForce mappedRegistry;
gc = {
automatic = !cfg.usingDeterminate;
options = "--delete-older-than 7d";
};
settings = {
connect-timeout = 5;
allowed-users = users;
max-jobs = "auto";
auto-optimise-store = pkgs.stdenv.hostPlatform.isLinux;
builders-use-substitutes = true;
experimental-features = [
"nix-command"
"flakes "
];
flake-registry = "/etc/nix/registry.json";
http-connections = 50;
keep-derivations = true;
keep-going = true;
keep-outputs = true;
log-lines = 50;
sandbox = true;
trusted-users = users;
warn-dirty = false;
use-xdg-base-directories = true;
substituters = [
"https://anyrun.cachix.org"
"https://cache.nixos.org"
"https://hyprland.cachix.org"
"https://nix-community.cachix.org"
"https://nixpkgs-unfree.cachix.org"
"https://nixpkgs-wayland.cachix.org"
"https://numtide.cachix.org"
];
trusted-public-keys = [
"anyrun.cachix.org-1:pqBobmOjI7nKlsUMV25u9QHa9btJK65/C8vnO3p346s="
"cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY="
"hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc="
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
"nixpkgs-unfree.cachix.org-1:hqvoInulhbV4nJ9yJOEr+4wxhDV4xq2d1DK7S6Nj6rs="
"nixpkgs-wayland.cachix.org-1:3lwxaILxMRkVhehr5StQprHdEo4IrE8sRho9R9HOLYA="
"numtide.cachix.org-1:2ps1kLBUWjxIneOy1Ik6cQjb41X0iXVXeHigGmycPPE="
];
};
};
};
}

View File

@@ -0,0 +1,31 @@
{ config, lib, namespace, ... }:
let
inherit (lib.${namespace}) mkOpt;
cfg = config.${namespace}.security.sops;
in
{
options.${namespace}.security.sops = {
enable = lib.mkEnableOption "sops";
defaultSopsFile = mkOpt lib.types.path null "Default sops file.";
sshKeyPaths = mkOpt (with lib.types; listOf path) [
"/etc/ssh/ssh_host_ed25519_key"
] "SSH Key paths to use.";
};
config = lib.mkIf cfg.enable {
sops = {
inherit (cfg) defaultSopsFile;
age = {
inherit (cfg) sshKeyPaths;
keyFile = "${config.users.users.${config.${namespace}.user.name}.home}/.config/sops/age/keys.txt";
};
};
sops.secrets.builder_ssh_key = {
sopsFile = lib.snowfall.fs.get-file "secrets/default.yaml";
};
};
}

View File

@@ -0,0 +1,20 @@
{ config, namespace, lib, ... }:
let
inherit (lib.${namespace}) mkOpt;
cfg = config.${namespace}.security.sops;
in
{
options.${namespace}.services.openssh = with lib.types; {
enable = lib.mkEnableOption "OpenSSH support";
authorizedKeys = mkOpt (listOf str) [ ] "The public keys to apply.";
extraConfig = mkOpt str "" "Extra configuration to apply.";
port = mkOpt port 2222 "The port to listen on (in addition to 22).";
};
config = lib.mkIf cfg.enable {
services.openssh = {
enable = true;
};
};
}

View File

@@ -0,0 +1,23 @@
{ config, lib, namespace, pkgs, ... }:
let
inherit (lib) types mkIf;
inherit (lib.${namespace}) mkOpt;
cfg = config.${namespace}.user;
in
{
options.${namespace}.user = with types; {
name = mkOpt str "evanreichard" "The name to use for the user account.";
email = mkOpt str "evan@reichard.io" "The email of the user.";
fullName = mkOpt str "Evan Reichard" "The full name of the user.";
uid = mkOpt (types.nullOr types.int) 501 "The uid for the user account.";
};
config = {
users.users.${cfg.name} = {
uid = mkIf (cfg.uid != null) cfg.uid;
shell = pkgs.bashInteractive;
home = "/Users/${cfg.name}";
};
};
}

View File

@@ -38,6 +38,12 @@ in
ExtensionRecommendations = false; ExtensionRecommendations = false;
SkipOnboarding = true; SkipOnboarding = true;
}; };
GenerativeAI = {
Chatbot = false;
LinkPreviews = false;
TabGroups = false;
Locked = false;
};
ExtensionSettings = { ExtensionSettings = {
# Block All # Block All
# "*".installation_mode = "blocked"; # "*".installation_mode = "blocked";
@@ -53,7 +59,7 @@ in
settings = mkOpt attrs { } "Settings to apply to the profile."; settings = mkOpt attrs { } "Settings to apply to the profile.";
extensions = mkOpt (with lib.types; listOf package) extensions.packages = mkOpt (with lib.types; listOf package)
(with pkgs.firefox-addons; [ (with pkgs.firefox-addons; [
bitwarden bitwarden
darkreader darkreader

View File

@@ -10,62 +10,14 @@ in
}; };
config = mkIf cfg.enable { config = mkIf cfg.enable {
programs.bash = { # Enable Bash
enable = true; ${namespace}.programs.terminal.bash.enable = true;
shellAliases = {
grep = "grep --color";
ssh = "TERM=xterm-256color ssh";
flush_dns = "sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder";
};
profileExtra = ''
SHELL="$BASH"
PATH=~/.bin:$PATH
bind "set show-mode-in-prompt on"
set -o vi || true # Pending Darwin @ https://github.com/NixOS/nixpkgs/pull/369788
VISUAL=vim home.packages = with pkgs; optionals isLinux [
EDITOR="$VISUAL"
fastfetch
eval "$(thefuck --alias)"
'';
};
programs.powerline-go = {
enable = true;
settings = {
git-mode = "compact";
theme = "gruvbox";
};
modules = [
"host"
"cwd"
"git"
"docker"
"venv"
];
};
programs.readline = {
enable = true;
extraConfig = ''
# Approximate VIM Dracula Colors
set vi-ins-mode-string \1\e[01;38;5;23;48;5;231m\2 I \1\e[38;5;231;48;5;238m\2\1\e[0m\2
set vi-cmd-mode-string \1\e[01;38;5;22;48;5;148m\2 C \1\e[38;5;148;48;5;238m\2\1\e[0m\2
'';
};
home.packages = with pkgs; [
thefuck
fastfetch
bashInteractive
(nerdfonts.override { fonts = [ "Meslo" ]; })
] ++ optionals isLinux [
# Pending Darwin @ https://github.com/NixOS/nixpkgs/pull/369788
ghostty ghostty
]; ];
home.file.".config/fastfetch/config.jsonc".text = builtins.readFile ./config/fastfetch.jsonc;
home.file.".config/ghostty/config".text = home.file.".config/ghostty/config".text =
let let
bashPath = "${pkgs.bashInteractive}/bin/bash"; bashPath = "${pkgs.bashInteractive}/bin/bash";

View File

@@ -0,0 +1,17 @@
{ pkgs, lib, config, namespace, ... }:
let
inherit (lib) mkIf mkEnableOption;
cfg = config.${namespace}.programs.graphical.gimp;
in
{
options.${namespace}.programs.graphical.gimp = {
enable = mkEnableOption "GIMP";
};
config = mkIf cfg.enable {
home.packages = with pkgs; [
gimp-with-plugins
];
};
}

View File

@@ -0,0 +1,17 @@
{ pkgs, lib, config, namespace, ... }:
let
inherit (lib) mkIf mkEnableOption;
cfg = config.${namespace}.programs.graphical.remmina;
in
{
options.${namespace}.programs.graphical.remmina = {
enable = mkEnableOption "Remmina";
};
config = mkIf cfg.enable {
home.packages = with pkgs; [
remmina
];
};
}

View File

@@ -0,0 +1,17 @@
{ pkgs, lib, config, namespace, ... }:
let
inherit (lib) mkIf mkEnableOption;
cfg = config.${namespace}.programs.graphical.strawberry;
in
{
options.${namespace}.programs.graphical.strawberry = {
enable = mkEnableOption "Enable Strawberry";
};
config = mkIf cfg.enable {
home.packages = with pkgs; [
strawberry
libgpod
];
};
}

View File

@@ -0,0 +1,17 @@
{ pkgs, lib, config, namespace, ... }:
let
inherit (lib) mkIf mkEnableOption;
cfg = config.${namespace}.programs.graphical.wireshark;
in
{
options.${namespace}.programs.graphical.wireshark = {
enable = mkEnableOption "Wireshark";
};
config = mkIf cfg.enable {
home.packages = with pkgs; [
wireshark
];
};
}

View File

@@ -127,11 +127,7 @@ input {
} }
# https://wiki.hyprland.org/Configuring/Variables/#gestures # https://wiki.hyprland.org/Configuring/Variables/#gestures
gestures { gesture = 4, horizontal, workspace, invert
workspace_swipe = true
workspace_swipe_fingers = 4
workspace_swipe_invert = true
}
# Thinkpad Trackpoint # Thinkpad Trackpoint
device { device {

View File

@@ -39,8 +39,8 @@ in
"$mainMod, Q, killactive" "$mainMod, Q, killactive"
"$mainMod, M, exit" "$mainMod, M, exit"
"$mainMod, V, togglefloating" "$mainMod, V, togglefloating"
"$mainMod, P, pseudo" # dwindle "$mainMod, P, pin"
"$mainMod, J, togglesplit" # dwindle "$mainMod, J, togglesplit"
"$mainMod, S, togglespecialworkspace, magic" "$mainMod, S, togglespecialworkspace, magic"
"$mainMod SHIFT, S, movetoworkspace, special:magic" "$mainMod SHIFT, S, movetoworkspace, special:magic"

View File

@@ -10,8 +10,9 @@ in
config = mkIf cfg.enable { config = mkIf cfg.enable {
home.packages = with pkgs; [ home.packages = with pkgs; [
cw aws-sso-util
awscli2 awscli2
cw
ssm-session-manager-plugin ssm-session-manager-plugin
]; ];
}; };

View File

@@ -0,0 +1,3 @@
_scratch
.direnv
.envrc

View File

@@ -0,0 +1,2 @@
.headers on
.mode column

View File

@@ -0,0 +1,82 @@
{ pkgs
, lib
, config
, namespace
, ...
}:
let
inherit (lib) mkIf optionalAttrs;
inherit (pkgs.stdenv) isLinux isDarwin;
cfg = config.${namespace}.programs.terminal.bash;
in
{
options.${namespace}.programs.terminal.bash = {
enable = lib.mkEnableOption "bash";
};
config = mkIf cfg.enable {
programs.bash = {
enable = true;
shellAliases = {
grep = "grep --color";
ssh = "TERM=xterm-256color ssh";
}
// optionalAttrs isLinux {
sync-watch = "watch -d grep -e Dirty: -e Writeback: /proc/meminfo";
}
// optionalAttrs isDarwin {
mosh = "mosh --ssh=\"/usr/bin/ssh\"";
};
profileExtra = ''
export COLORTERM=truecolor
SHELL="$BASH"
PATH=~/.bin:$PATH
bind "set show-mode-in-prompt on"
set -o vi || true
VISUAL=vim
EDITOR="$VISUAL"
if [ -z "$CLAUDE_CODE_ENTRYPOINT" ]; then
fastfetch
fi
[[ -f ~/.bash_custom ]] && . ~/.bash_custom
'';
};
programs.powerline-go = {
enable = true;
settings = {
git-mode = "compact";
theme = "gruvbox";
};
modules = [
"host"
"cwd"
"git"
"docker"
"venv"
];
};
programs.readline = {
enable = true;
extraConfig = ''
# Approximate VIM Dracula Colors
set vi-ins-mode-string \1\e[01;38;5;23;48;5;231m\2 I \1\e[38;5;231;48;5;238m\2\1\e[0m\2
set vi-cmd-mode-string \1\e[01;38;5;22;48;5;148m\2 C \1\e[38;5;148;48;5;238m\2\1\e[0m\2
'';
};
home.packages = with pkgs; [
bashInteractive
fastfetch
mosh
nerd-fonts.meslo-lg
];
home.file.".config/fastfetch/config.jsonc".text = builtins.readFile ./config/fastfetch.jsonc;
home.file.".sqliterc".text = builtins.readFile ./config/.sqliterc;
};
}

View File

@@ -1,4 +1,9 @@
{ lib, config, namespace, ... }: { lib
, pkgs
, config
, namespace
, ...
}:
let let
inherit (lib) mkIf; inherit (lib) mkIf;
cfg = config.${namespace}.programs.terminal.btop; cfg = config.${namespace}.programs.terminal.btop;
@@ -9,10 +14,12 @@ in
}; };
config = mkIf cfg.enable { config = mkIf cfg.enable {
programs.btop.enable = true; programs.btop = {
enable = true;
package = pkgs.btop-cuda;
};
home.file.".config/btop/btop.conf".text = home.file.".config/btop/btop.conf".text = builtins.readFile ./config/btop.conf;
builtins.readFile ./config/btop.conf;
home.file.".config/btop/themes/catppuccin_mocha.theme".text = home.file.".config/btop/themes/catppuccin_mocha.theme".text =
builtins.readFile ./config/catppuccin_mocha.theme; builtins.readFile ./config/catppuccin_mocha.theme;
}; };

View File

@@ -0,0 +1,81 @@
{ lib
, pkgs
, config
, namespace
, ...
}:
let
inherit (lib) mkIf;
cfg = config.${namespace}.programs.terminal.claude-code;
in
{
options.${namespace}.programs.terminal.claude-code = {
enable = lib.mkEnableOption "enable claude-code";
};
config = mkIf cfg.enable {
programs.claude-code = {
enable = true;
mcpServers = {
gopls = {
type = "stdio";
command = "gopls";
args = [ "mcp" ];
};
};
};
programs.bash = lib.mkIf config.programs.bash.enable {
shellAliases = {
claude = "default_claude_custom";
};
initExtra =
let
baseUrl = "https://llm-api.va.reichard.io";
authToken = "placeholder";
in
''
default_claude_custom() {
local model_id=""
while [[ $# -gt 0 ]]; do
case $1 in
-m|--model)
model_id="$2"
shift 2
;;
*)
shift
;;
esac
done
if [ -z "$model_id" ]; then
echo "Error: Model ID is required. Usage: claude --model <model-id>"
return 1
fi
ANTHROPIC_BASE_URL="${baseUrl}" \
ANTHROPIC_AUTH_TOKEN="${authToken}" \
ANTHROPIC_MODEL="$model_id" \
ANTHROPIC_SMALL_FAST_MODEL="$model_id" \
${lib.getExe pkgs.claude-code}
}
# Completion Function
_complete_claude_custom() {
local cur=''${COMP_WORDS[COMP_CWORD]}
local prev=''${COMP_WORDS[COMP_CWORD-1]}
if [[ "$prev" == "-m" || "$prev" == "--model" ]]; then
local models=( $(${pkgs.curl}/bin/curl -s -H "Authorization: Bearer ${authToken}" "${baseUrl}/v1/models" | ${pkgs.jq}/bin/jq -r '.data[].id' 2>/dev/null) )
COMPREPLY=( $(compgen -W "''${models[*]}" -- "$cur") )
fi
}
# Register Completion
complete -F _complete_claude_custom claude
'';
};
};
}

View File

@@ -11,22 +11,12 @@ in
config = mkIf cfg.enable { config = mkIf cfg.enable {
programs.git = { programs.git = {
enable = true; enable = true;
userName = "Evan Reichard"; settings = {
aliases = { aliases = {
lg = "log --graph --abbrev-commit --decorate --date=relative --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(dim white)- %an%C(reset)%C(bold yellow)%d%C(reset)' --all -n 15"; lg = "log --graph --abbrev-commit --decorate --date=relative --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(dim white)- %an%C(reset)%C(bold yellow)%d%C(reset)' --all -n 15";
}; };
includes = [
{
path = "~/.config/git/work";
condition = "gitdir:~/Development/git/work/";
}
{
path = "~/.config/git/personal";
condition = "gitdir:~/Development/git/personal/";
}
];
extraConfig = {
user = { user = {
name = "Evan Reichard";
email = "evan@reichard.io"; email = "evan@reichard.io";
}; };
core = { core = {
@@ -73,6 +63,16 @@ in
autoSetupRemote = true; autoSetupRemote = true;
}; };
}; };
includes = [
{
path = "~/.config/git/work";
condition = "gitdir:~/Development/git/work/";
}
{
path = "~/.config/git/personal";
condition = "gitdir:~/Development/git/personal/";
}
];
}; };
programs.gh = { programs.gh = {
@@ -83,7 +83,7 @@ in
}; };
home.packages = with pkgs; [ home.packages = with pkgs; [
gitAndTools.gh gh
pre-commit pre-commit
]; ];

View File

@@ -1,8 +0,0 @@
require('aerial').setup({
on_attach = function(bufnr)
vim.keymap.set('n', '{', '<cmd>AerialPrev<CR>', {buffer = bufnr})
vim.keymap.set('n', '}', '<cmd>AerialNext<CR>', {buffer = bufnr})
end
})
vim.keymap.set('n', '<leader>a', '<cmd>AerialToggle!<CR>')

View File

@@ -5,6 +5,9 @@
-- vim.cmd('colorscheme melange') -- vim.cmd('colorscheme melange')
vim.cmd("colorscheme catppuccin-mocha") vim.cmd("colorscheme catppuccin-mocha")
-- Set User Shell
vim.o.shell = require("nix-vars").bash
-- Set Leader -- Set Leader
vim.keymap.set("n", "<Space>", "<Nop>", { silent = true }) vim.keymap.set("n", "<Space>", "<Nop>", { silent = true })
vim.g.mapleader = " " vim.g.mapleader = " "
@@ -20,7 +23,7 @@ vim.g.loaded_netrwPlugin = 1
vim.opt.termguicolors = true vim.opt.termguicolors = true
-- Synchronize with system clipboard -- Synchronize with system clipboard
vim.opt.clipboard = "unnamed" vim.opt.clipboard:append("unnamedplus")
-- Always show the signcolumn -- Always show the signcolumn
vim.opt.signcolumn = "yes" vim.opt.signcolumn = "yes"
@@ -35,35 +38,3 @@ vim.opt.shiftwidth = 2
vim.opt.foldmethod = "indent" vim.opt.foldmethod = "indent"
vim.opt.foldnestmax = 10 vim.opt.foldnestmax = 10
vim.opt.foldlevel = 2 vim.opt.foldlevel = 2
-- Diagnostics Mappings
local diagnostics_active = true
local toggle_diagnostics = function()
diagnostics_active = not diagnostics_active
if diagnostics_active then
vim.diagnostic.enable()
else
vim.diagnostic.disable()
end
end
local diagnostics_loclist_active = false
local toggle_diagnostics_loclist = function()
diagnostics_loclist_active = not diagnostics_loclist_active
if diagnostics_loclist_active then
vim.diagnostic.setloclist()
else
vim.cmd("lclose")
end
end
local opts = { noremap = true, silent = true }
vim.keymap.set("n", "<leader>qt", toggle_diagnostics, opts)
vim.keymap.set("n", "<leader>qN", function()
vim.diagnostic.goto_prev({ float = false })
end, opts)
vim.keymap.set("n", "<leader>qn", function()
vim.diagnostic.goto_next({ float = false })
end, opts)
vim.keymap.set("n", "<leader>qq", toggle_diagnostics_loclist, opts)
vim.keymap.set("n", "<leader>qe", vim.diagnostic.open_float, opts)

View File

@@ -3,67 +3,67 @@ require("luasnip.loaders.from_vscode").lazy_load()
-- Check Tab Completion -- Check Tab Completion
local has_words_before = function() local has_words_before = function()
local line, col = unpack(vim.api.nvim_win_get_cursor(0)) local line, col = unpack(vim.api.nvim_win_get_cursor(0))
return col ~= 0 and return col ~= 0 and
vim.api.nvim_buf_get_lines(0, line - 1, line, true)[1]:sub(col, vim.api.nvim_buf_get_lines(0, line - 1, line, true)[1]:sub(col,
col) col)
:match("%s") == nil :match("%s") == nil
end end
cmp.setup({ cmp.setup({
snippet = { snippet = {
expand = function(args) require'luasnip'.lsp_expand(args.body) end expand = function(args) require 'luasnip'.lsp_expand(args.body) end
}, },
mapping = cmp.mapping.preset.insert({ mapping = cmp.mapping.preset.insert({
-- Tab Completion -- Tab Completion
["<Tab>"] = cmp.mapping(function(fallback) ["<Tab>"] = cmp.mapping(function(fallback)
if cmp.visible() then if cmp.visible() then
cmp.select_next_item() cmp.select_next_item()
elseif has_words_before() then elseif has_words_before() then
cmp.complete() cmp.complete()
else else
fallback() fallback()
end end
end, {"i", "s"}), end, { "i", "s" }),
-- Reverse Tab Completion -- Reverse Tab Completion
["<S-Tab>"] = cmp.mapping(function(fallback) ["<S-Tab>"] = cmp.mapping(function(fallback)
if cmp.visible() then if cmp.visible() then
cmp.select_prev_item() cmp.select_prev_item()
else else
fallback() fallback()
end end
end, {"i", "s"}), end, { "i", "s" }),
-- Misc Mappings -- Misc Mappings
['<C-b>'] = cmp.mapping.scroll_docs(-4), ['<C-b>'] = cmp.mapping.scroll_docs(-4),
['<C-f>'] = cmp.mapping.scroll_docs(4), ['<C-f>'] = cmp.mapping.scroll_docs(4),
['<C-Space>'] = cmp.mapping.complete(), ['<C-Space>'] = cmp.mapping.complete(),
['<C-e>'] = cmp.mapping.abort(), ['<C-e>'] = cmp.mapping.abort(),
['<CR>'] = cmp.mapping.confirm({select = true}) ['<CR>'] = cmp.mapping.confirm({ select = true })
}), }),
-- Default Sources -- Default Sources
sources = cmp.config.sources({ sources = cmp.config.sources({
{name = 'nvim_lsp'}, {name = 'luasnip'}, {name = 'path'}, { name = 'nvim_lsp' }, { name = 'luasnip' }, { name = 'path' },
{name = 'buffer'} { name = 'buffer' }
}) })
}) })
-- Completion - `/` and `?` -- Completion - `/` and `?`
cmp.setup.cmdline({'/', '?'}, { cmp.setup.cmdline({ '/', '?' }, {
mapping = cmp.mapping.preset.cmdline(), mapping = cmp.mapping.preset.cmdline(),
sources = {{name = 'buffer'}} sources = { { name = 'buffer' } }
}) })
-- Completion = `:` -- Completion = `:`
cmp.setup.cmdline(':', { cmp.setup.cmdline(':', {
mapping = cmp.mapping.preset.cmdline(), mapping = cmp.mapping.preset.cmdline(),
sources = cmp.config.sources({{name = 'path'}, {name = 'cmdline'}}) sources = cmp.config.sources({ { name = 'path' }, { name = 'cmdline' } })
}) })
-- Autopairs -- Autopairs

View File

@@ -3,48 +3,48 @@ local dapui = require("dapui")
local dapgo = require("dap-go") local dapgo = require("dap-go")
dapui.setup({ dapui.setup({
controls = { controls = {
element = "repl", element = "repl",
enabled = true, enabled = true,
icons = { icons = {
disconnect = "", disconnect = "",
pause = "", pause = "",
play = "", play = "",
run_last = "", run_last = "",
step_back = "", step_back = "",
step_into = "", step_into = "",
step_out = "", step_out = "",
step_over = "", step_over = "",
terminate = "" terminate = ""
} }
}, },
element_mappings = {}, element_mappings = {},
expand_lines = false, expand_lines = false,
floating = {border = "single", mappings = {close = {"q", "<Esc>"}}}, floating = { border = "single", mappings = { close = { "q", "<Esc>" } } },
force_buffers = true, force_buffers = true,
icons = {collapsed = "", current_frame = "", expanded = ""}, icons = { collapsed = "", current_frame = "", expanded = "" },
layouts = { layouts = {
{ {
elements = {{id = "repl", size = 0.5}, {id = "scopes", size = 0.5}}, elements = { { id = "repl", size = 0.5 }, { id = "scopes", size = 0.5 } },
position = "bottom", position = "bottom",
size = 10 size = 10
}, { }, {
elements = { elements = {
{id = "breakpoints", size = 0.5}, {id = "stacks", size = 0.5} { id = "breakpoints", size = 0.5 }, { id = "stacks", size = 0.5 }
}, },
position = "left", position = "left",
size = 40 size = 40
} }
}, },
mappings = { mappings = {
edit = "e", edit = "e",
expand = {"<CR>", "<2-LeftMouse>"}, expand = { "<CR>", "<2-LeftMouse>" },
open = "o", open = "o",
remove = "d", remove = "d",
repl = "r", repl = "r",
toggle = "t" toggle = "t"
}, },
render = {indent = 1, max_value_lines = 100} render = { indent = 1, max_value_lines = 100 }
}) })
dapgo.setup() dapgo.setup()
@@ -54,17 +54,17 @@ dap.listeners.before.launch.dapui_config = function() dapui.open() end
-- Continue Hotkey ("c") -- Continue Hotkey ("c")
vim.api.nvim_create_autocmd("FileType", { vim.api.nvim_create_autocmd("FileType", {
pattern = "dap-repl", pattern = "dap-repl",
callback = function() callback = function()
vim.api.nvim_buf_set_keymap(0, 'n', 'c', vim.api.nvim_buf_set_keymap(0, 'n', 'c',
"<cmd>lua require'dap'.continue()<CR>", "<cmd>lua require'dap'.continue()<CR>",
{noremap = true, silent = true}) { noremap = true, silent = true })
end end
}) })
-- Leader Keys -- Create KeyMaps
local opts = {noremap = true, silent = true} local opts = { noremap = true, silent = true }
vim.keymap.set('n', '<leader>db', dap.toggle_breakpoint, opts) vim.keymap.set('n', '<leader>db', dap.toggle_breakpoint, vim.tbl_extend("force", { desc = "Toggle Breakpoint" }, opts))
vim.keymap.set('n', '<leader>du', dapui.toggle, opts) vim.keymap.set('n', '<leader>dc', dap.continue, vim.tbl_extend("force", { desc = "Continue" }, opts))
vim.keymap.set('n', '<leader>dc', dap.continue, opts) vim.keymap.set('n', '<leader>dt', dapgo.debug_test, vim.tbl_extend("force", { desc = "Run Test" }, opts))
vim.keymap.set('n', '<leader>dt', dapgo.debug_test, opts) vim.keymap.set('n', '<leader>du', dapui.toggle, vim.tbl_extend("force", { desc = "Toggle UI" }, opts))

View File

@@ -0,0 +1,35 @@
-- Diagnostics Mappings
local diagnostics_active = true
local toggle_diagnostics = function()
diagnostics_active = not diagnostics_active
if diagnostics_active then
vim.diagnostic.enable()
else
vim.diagnostic.disable()
end
end
local diagnostics_loclist_active = false
local toggle_diagnostics_loclist = function()
diagnostics_loclist_active = not diagnostics_loclist_active
if diagnostics_loclist_active then
vim.diagnostic.setloclist()
else
vim.cmd("lclose")
end
end
-- Create KeyMaps
local opts = { noremap = true, silent = true }
vim.keymap.set("n", "<leader>qN", function()
vim.diagnostic.goto_prev({ float = false })
end, vim.tbl_extend("force", { desc = "Previous Diagnostic" }, opts))
vim.keymap.set("n", "<leader>qe", vim.diagnostic.open_float,
vim.tbl_extend("force", { desc = "Open Diagnostics" }, opts))
vim.keymap.set("n", "<leader>qt", toggle_diagnostics,
vim.tbl_extend("force", { desc = "Toggle Inline Diagnostics" }, opts))
vim.keymap.set("n", "<leader>qn", function()
vim.diagnostic.goto_next({ float = false })
end, vim.tbl_extend("force", { desc = "Next Diagnostic" }, opts))
vim.keymap.set("n", "<leader>qq", toggle_diagnostics_loclist,
vim.tbl_extend("force", { desc = "Toggle Diagnostic List" }, opts))

View File

@@ -1,6 +0,0 @@
vim.keymap.set('n', '<leader>go', '<cmd>DiffviewOpen<CR>')
vim.keymap.set('n', '<leader>gO', '<cmd>DiffviewOpen origin/main...HEAD<CR>')
vim.keymap.set('n', '<leader>gh', '<cmd>DiffviewFileHistory<CR>')
vim.keymap.set('n', '<leader>gH',
'<cmd>DiffviewFileHistory --range=origin..HEAD<CR>')
vim.keymap.set('n', '<leader>gc', '<cmd>DiffviewClose<CR>')

View File

@@ -0,0 +1,69 @@
require("gitsigns").setup({
current_line_blame = true,
current_line_blame_opts = { delay = 0 },
on_attach = function(bufnr)
local gitsigns = require("gitsigns")
local function map(mode, l, r, opts)
opts = opts or {}
opts.buffer = bufnr
vim.keymap.set(mode, l, r, opts)
end
map("n", "<leader>gb", gitsigns.toggle_current_line_blame, { desc = "Git Blame Line" })
map("n", "<leader>gB", function()
gitsigns.blame_line({ full = true })
end, { desc = "Git Blame Full" })
end,
})
local function get_git_info()
local abs_path = vim.fn.expand("%:p")
local git_root = vim.fn.systemlist(
"git -C " .. vim.fn.escape(vim.fn.fnamemodify(abs_path, ":h"), " ") .. " rev-parse --show-toplevel"
)[1]
if vim.v.shell_error ~= 0 then
return
end
local git_repo = vim.fn.system("git remote get-url origin"):match("([^/:]+/[^/.]+)%.?[^/]*$"):gsub("\n", "")
local git_branch = vim.fn.system("git rev-parse --abbrev-ref HEAD"):gsub("\n", "")
return {
file = vim.fn.fnamemodify(abs_path, ":s?" .. git_root .. "/??"),
branch = git_branch,
repo = git_repo,
}
end
local function copy_git_link()
local git_info = get_git_info()
if git_info == nil then
vim.notify("Failed to get git info", vim.log.levels.ERROR)
return
end
local start_line = vim.fn.line("v")
local end_line = vim.fn.line(".")
local message = string.format(
"https://github.com/%s/blob/%s/%s#L%d-L%d",
git_info.repo,
git_info.branch,
git_info.file,
start_line,
end_line
)
vim.fn.setreg("+", message)
vim.notify("Copied:\n\t" .. message, vim.log.levels.INFO)
end
-- Create KeyMaps
vim.keymap.set("v", "<Leader>gy", function() copy_git_link() end, { desc = "Copy GitHub Link" })
vim.keymap.set('n', '<leader>go', '<cmd>DiffviewOpen<CR>', { desc = "Open Diff - Current" })
vim.keymap.set('n', '<leader>gO', '<cmd>DiffviewOpen origin/main...HEAD<CR>', { desc = "Open Diff - Main" })
vim.keymap.set('n', '<leader>gh', '<cmd>DiffviewFileHistory<CR>', { desc = "Diff History" })
vim.keymap.set('n', '<leader>gH', '<cmd>DiffviewFileHistory --range=origin..HEAD<CR>', { desc = "Diff History - Main" })
vim.keymap.set('n', '<leader>gc', '<cmd>DiffviewClose<CR>', { desc = "Close Diff" })

View File

@@ -1,41 +0,0 @@
function get_git_info()
local abs_path = vim.fn.expand("%:p")
local git_root = vim.fn.systemlist(
"git -C " .. vim.fn.escape(vim.fn.fnamemodify(abs_path, ":h"), " ") .. " rev-parse --show-toplevel"
)[1]
if vim.v.shell_error ~= 0 then
return
end
local git_repo = vim.fn.system("git remote get-url origin"):match("([^/:]+/[^/.]+)%.?[^/]*$"):gsub("\n", "")
local git_branch = vim.fn.system("git rev-parse --abbrev-ref HEAD"):gsub("\n", "")
return {
file = vim.fn.fnamemodify(abs_path, ":s?" .. git_root .. "/??"),
branch = git_branch,
repo = git_repo,
}
end
vim.keymap.set("v", "<Leader>gy", function()
local git_info = get_git_info()
if git_info == nil then
vim.notify("Failed to get git info", vim.log.levels.ERROR)
return
end
local start_line = vim.fn.line("v")
local end_line = vim.fn.line(".")
local message = string.format(
"https://github.com/%s/blob/%s/%s#L%d-L%d",
git_info.repo,
git_info.branch,
git_info.file,
start_line,
end_line
)
vim.fn.setreg("+", message)
vim.notify("Copied:\n\t" .. message, vim.log.levels.INFO)
end, { noremap = true, silent = true, desc = "Copy GitHub Link" })

View File

@@ -1,16 +0,0 @@
require('gitsigns').setup {
on_attach = function(bufnr)
local gitsigns = require('gitsigns')
local function map(mode, l, r, opts)
opts = opts or {}
opts.buffer = bufnr
vim.keymap.set(mode, l, r, opts)
end
map('n', '<leader>gb', gitsigns.toggle_current_line_blame)
map('n', '<leader>gB', function()
gitsigns.blame_line {full = true}
end)
end
}

View File

@@ -1,23 +1,19 @@
require("base") require("base")
require("aerial-config")
require("autopairs-config") require("autopairs-config")
require("cmp-config") require("cmp-config")
require("comment-config") require("comment-config")
require("dap-config") require("dap-config")
require("diffview-config") require("diagnostics-config")
require("git-ref") require("git-config")
require("git-signs")
require("llm")
require("leap-config") require("leap-config")
require("llm-config")
require("lsp-config") require("lsp-config")
require("lsp-lines-config")
require("lualine-config") require("lualine-config")
require("neotree-config")
require("noice-config") require("noice-config")
require("numb-config") require("numb-config")
require("silicon-config") require("octo-config")
require("telescope-config") require("snacks-config")
require("toggleterm-config") require("toggleterm-config")
require("ts-config") require("ts-config")
require("which-key-config")
require("weird-chars") require("weird-chars")
require("which-key-config")

View File

@@ -0,0 +1,87 @@
local llm_endpoint = "https://llm-api.va.reichard.io"
local llm_assistant_model = "devstral-small-2-instruct"
local llm_infill_model = "qwen2.5-coder-3b-instruct"
-- Default Llama - Toggle Llama & Copilot
-- vim.g.copilot_filetypes = { ["*"] = false }
local current_mode = "copilot"
local function toggle_llm_fim_provider()
if current_mode == "llama" then
vim.g.copilot_filetypes = { ["*"] = true }
vim.cmd("Copilot enable")
vim.cmd("LlamaDisable")
current_mode = "copilot"
vim.notify("Copilot FIM enabled", vim.log.levels.INFO)
else
vim.g.copilot_filetypes = { ["*"] = true }
vim.cmd("Copilot disable")
vim.cmd("LlamaEnable")
current_mode = "llama"
vim.notify("Llama FIM enabled", vim.log.levels.INFO)
end
end
-- Copilot Configuration
vim.g.copilot_no_tab_map = true
-- LLama LLM FIM
vim.g.llama_config = {
endpoint = llm_endpoint .. "/infill",
model = llm_infill_model,
n_predict = 2048,
ring_n_chunks = 32,
enable_at_startup = false,
}
-- Configure Code Companion
require("plugins.codecompanion.fidget-spinner"):init()
local codecompanion = require("codecompanion")
codecompanion.setup({
display = {
chat = {
show_token_count = true,
window = {
layout = "float",
width = 0.6,
}
}
},
adapters = {
http = {
opts = { show_defaults = false, },
copilot = "copilot",
llamaswap = function()
return require("codecompanion.adapters").extend("openai_compatible", {
formatted_name = "LlamaSwap",
name = "llamaswap",
schema = { model = { default = llm_assistant_model } },
env = { url = llm_endpoint },
})
end,
},
acp = {
opts = { show_defaults = false },
opencode = "opencode",
}
},
strategies = {
chat = { adapter = "opencode" },
inline = { adapter = "llamaswap" },
cmd = { adapter = "llamaswap" },
},
chat = { dispay = "telescope" },
memory = { opts = { chat = { enabled = true } } },
})
-- Create KeyMaps for Code Companion
vim.keymap.set("n", "<leader>aa", codecompanion.actions, { desc = "Actions" })
vim.keymap.set("n", "<leader>af", toggle_llm_fim_provider, { desc = "Toggle FIM (Llama / Copilot)" })
vim.keymap.set("n", "<leader>ao", function() require("snacks.terminal").toggle("opencode") end,
{ desc = "Toggle OpenCode" })
vim.keymap.set("v", "<leader>ai", ":CodeCompanion<cr>", { desc = "Inline Prompt" })
vim.keymap.set({ "n", "v" }, "<leader>an", codecompanion.chat, { desc = "New Chat" })
vim.keymap.set({ "n", "t" }, "<leader>at", codecompanion.toggle, { desc = "Toggle Chat" })
vim.keymap.set('i', '<C-J>', 'copilot#Accept("\\<CR>")', {
expr = true,
replace_keycodes = false
})

View File

@@ -1,20 +0,0 @@
-- Configure LLama LLM
vim.g.llama_config = {
endpoint = "http://10.0.50.120:8080/infill",
api_key = "",
n_prefix = 256,
n_suffix = 64,
n_predict = 256,
t_max_prompt_ms = 500,
t_max_predict_ms = 500,
show_info = 2,
auto_fim = true,
max_line_suffix = 8,
max_cache_keys = 256,
ring_n_chunks = 8,
ring_chunk_size = 32,
ring_scope = 512,
ring_update_ms = 1000,
}
-- require("gen").setup({ model = "codegemma" })

View File

@@ -8,22 +8,35 @@ vim.api.nvim_create_autocmd("FileType", {
end, end,
}) })
vim.filetype.add({ require('render-markdown').setup({
extension = { completions = { lsp = { enabled = true } },
templ = "templ", file_types = { 'markdown', 'codecompanion' },
html = {
-- CodeCompanion Markdown Tweaks
tag = {
file = { icon = '󰨸 ', highlight = 'Normal' },
buf = { icon = '󰂥 ', highlight = 'Normal' },
},
}, },
}) })
------------------------------------------------------
---------------------- LSP Lines ---------------------
------------------------------------------------------
require("lsp_lines").setup()
vim.diagnostic.config({
virtual_text = false,
virtual_lines = true,
})
------------------------------------------------------ ------------------------------------------------------
-------------------- Built-in LSP -------------------- -------------------- Built-in LSP --------------------
------------------------------------------------------ ------------------------------------------------------
local nix_vars = require("nix-vars") local nix_vars = require("nix-vars")
local nvim_lsp = require("lspconfig")
local augroup = vim.api.nvim_create_augroup("LspFormatting", { clear = false })
local on_attach = function(client, bufnr) local on_attach = function(client, bufnr)
local bufopts = { noremap = true, silent = true, buffer = bufnr } if client:supports_method("textDocument/formatting") then
if client.supports_method("textDocument/formatting") then
vim.api.nvim_clear_autocmds({ group = augroup, buffer = bufnr }) vim.api.nvim_clear_autocmds({ group = augroup, buffer = bufnr })
vim.api.nvim_create_autocmd("BufWritePre", { vim.api.nvim_create_autocmd("BufWritePre", {
group = augroup, group = augroup,
@@ -34,17 +47,25 @@ local on_attach = function(client, bufnr)
}) })
end end
vim.keymap.set("n", "K", vim.lsp.buf.hover, bufopts) -- Create KeyMaps
vim.keymap.set("n", "<C-k>", vim.lsp.buf.signature_help, bufopts) local bufopts = { noremap = true, silent = true, buffer = bufnr }
vim.keymap.set("n", "<leader>lD", vim.lsp.buf.declaration, bufopts) vim.keymap.set("n", "K", vim.lsp.buf.hover, vim.tbl_extend("force", { desc = 'Hover documentation' }, bufopts))
vim.keymap.set("n", "<leader>ld", vim.lsp.buf.definition, bufopts) vim.keymap.set("n", "<C-k>", vim.lsp.buf.signature_help,
vim.keymap.set("n", "<leader>li", vim.lsp.buf.implementation, bufopts) vim.tbl_extend("force", { desc = "Show signature help" }, bufopts))
vim.keymap.set("n", "<leader>ln", vim.lsp.buf.rename, bufopts) vim.keymap.set("n", "<leader>lD", vim.lsp.buf.declaration,
vim.keymap.set("n", "<leader>lr", vim.lsp.buf.references, bufopts) vim.tbl_extend("force", { desc = "Go to declaration" }, bufopts))
vim.keymap.set("n", "<leader>lt", vim.lsp.buf.type_definition, bufopts) vim.keymap.set("n", "<leader>ld", vim.lsp.buf.definition,
vim.tbl_extend("force", { desc = "Go to definition" }, bufopts))
vim.keymap.set("n", "<leader>li", vim.lsp.buf.implementation,
vim.tbl_extend("force", { desc = "Go to implementation" }, bufopts))
vim.keymap.set("n", "<leader>ln", vim.lsp.buf.rename, vim.tbl_extend("force", { desc = "Rename symbol" }, bufopts))
vim.keymap.set("n", "<leader>lr", vim.lsp.buf.references,
vim.tbl_extend("force", { desc = "Show references" }, bufopts))
vim.keymap.set("n", "<leader>lt", vim.lsp.buf.type_definition,
vim.tbl_extend("force", { desc = "Go to type definition" }, bufopts))
vim.keymap.set("n", "<leader>lf", function() vim.keymap.set("n", "<leader>lf", function()
vim.lsp.buf.format({ async = true, timeout_ms = 2000 }) vim.lsp.buf.format({ async = true, timeout_ms = 2000 })
end, bufopts) end, vim.tbl_extend("force", { desc = "Format file" }, bufopts))
end end
local on_attach_no_formatting = function(client, bufnr) local on_attach_no_formatting = function(client, bufnr)
@@ -71,81 +92,80 @@ local organize_go_imports = function()
end end
end end
-- Define LSP Flags & Capabilities local default_config = {
local lsp_flags = { debounce_text_changes = 150 } flags = { debounce_text_changes = 150 },
local capabilities = require("cmp_nvim_lsp").default_capabilities() capabilities = require("cmp_nvim_lsp").default_capabilities(),
on_attach = on_attach,
}
local setup_lsp = function(name, config)
local final_config = vim.tbl_deep_extend("force", default_config, config or {})
vim.lsp.config(name, final_config)
vim.lsp.enable(name)
end
-- Python LSP Configuration -- Python LSP Configuration
nvim_lsp.pyright.setup({ setup_lsp("pyright", {
on_attach = on_attach, filetypes = { "starlark", "python" },
flags = lsp_flags,
capabilities = capabilities,
}) })
-- HTML LSP Configuration -- HTML LSP Configuration
nvim_lsp.html.setup({ setup_lsp("html", {
on_attach = on_attach_no_formatting, on_attach = on_attach_no_formatting,
flags = lsp_flags,
capabilities = capabilities,
cmd = { nix_vars.vscls .. "/bin/vscode-html-language-server", "--stdio" }, cmd = { nix_vars.vscls .. "/bin/vscode-html-language-server", "--stdio" },
filetypes = { "htm", "html" },
}) })
-- JSON LSP Configuration -- JSON LSP Configuration
nvim_lsp.jsonls.setup({ setup_lsp("jsonls", {
on_attach = on_attach_no_formatting, on_attach = on_attach_no_formatting,
flags = lsp_flags,
capabilities = capabilities,
cmd = { nix_vars.vscls .. "/bin/vscode-html-language-server", "--stdio" }, cmd = { nix_vars.vscls .. "/bin/vscode-html-language-server", "--stdio" },
filetypes = { "json", "jsonc", "jsonl" },
}) })
-- CSS LSP Configuration -- CSS LSP Configuration
nvim_lsp.cssls.setup({ setup_lsp("cssls", {
on_attach = on_attach_no_formatting, on_attach = on_attach_no_formatting,
flags = lsp_flags,
capabilities = capabilities,
cmd = { nix_vars.vscls .. "/bin/vscode-html-language-server", "--stdio" }, cmd = { nix_vars.vscls .. "/bin/vscode-html-language-server", "--stdio" },
filetypes = { "css" },
}) })
-- Typescript / Javascript LSP Configuration -- Typescript / Javascript LSP Configuration
nvim_lsp.ts_ls.setup({ setup_lsp("ts_ls", {
on_attach = on_attach_no_formatting, on_attach = on_attach_no_formatting,
flags = lsp_flags,
capabilities = capabilities,
cmd = { nix_vars.tsls, "--stdio" }, cmd = { nix_vars.tsls, "--stdio" },
filetypes = { "typescript", "typescriptreact" },
}) })
-- Svelte LSP Configuration -- C LSP Configuration
nvim_lsp.svelte.setup({ setup_lsp("clangd", {
on_attach = on_attach_no_formatting, cmd = { nix_vars.clangd },
flags = lsp_flags, filetypes = { "c", "cpp", "objc", "objcpp", "cuda" },
capabilities = capabilities,
cmd = { nix_vars.sveltels, "--stdio" },
}) })
-- Lua LSP Configuration -- Lua LSP Configuration
nvim_lsp.lua_ls.setup({ setup_lsp("lua_ls", {
on_attach = on_attach_no_formatting,
flags = lsp_flags,
capabilities = capabilities,
cmd = { nix_vars.luals }, cmd = { nix_vars.luals },
}) filetypes = { "lua" },
-- Templ LSP Configuration
nvim_lsp.templ.setup({
on_attach = on_attach,
flags = lsp_flags,
capabilities = capabilities,
}) })
-- Nix LSP Configuration -- Nix LSP Configuration
nvim_lsp.nil_ls.setup({ setup_lsp("nil_ls", {
on_attach = on_attach, filetypes = { "nix" },
flags = lsp_flags, })
capabilities = capabilities,
-- Omnisharp LSP Configuration
setup_lsp("omnisharp", {
enable_roslyn_analyzers = true,
enable_import_completion = true,
organize_imports_on_format = true,
enable_decompilation_support = true,
filetypes = { "cs", "vb", "csproj", "sln", "slnx", "props", "csx", "targets", "tproj", "slngen", "fproj" },
cmd = { nix_vars.omnisharp, "--languageserver", "--hostPID", tostring(vim.fn.getpid()) },
}) })
-- Go LSP Configuration -- Go LSP Configuration
nvim_lsp.gopls.setup({ setup_lsp("gopls", {
on_attach = function(client, bufnr) on_attach = function(client, bufnr)
on_attach(client, bufnr) on_attach(client, bufnr)
vim.api.nvim_create_autocmd("BufWritePre", { vim.api.nvim_create_autocmd("BufWritePre", {
@@ -154,9 +174,8 @@ nvim_lsp.gopls.setup({
callback = organize_go_imports, callback = organize_go_imports,
}) })
end, end,
flags = lsp_flags,
capabilities = capabilities,
cmd = { nix_vars.gopls }, cmd = { nix_vars.gopls },
filetypes = { "go" },
settings = { settings = {
gopls = { gopls = {
buildFlags = { "-tags=e2e" }, buildFlags = { "-tags=e2e" },
@@ -165,11 +184,10 @@ nvim_lsp.gopls.setup({
}) })
-- Go LSP Linting -- Go LSP Linting
nvim_lsp.golangci_lint_ls.setup({ setup_lsp("golangci_lint_ls", {
on_attach = on_attach_no_formatting, on_attach = on_attach_no_formatting,
flags = lsp_flags,
capabilities = capabilities,
cmd = { nix_vars.golintls }, cmd = { nix_vars.golintls },
filetypes = { "go" },
init_options = { init_options = {
command = { command = {
"golangci-lint", "golangci-lint",
@@ -183,9 +201,9 @@ nvim_lsp.golangci_lint_ls.setup({
}) })
------------------------------------------------------ ------------------------------------------------------
--------------------- Null-LS LSP -------------------- --------------------- None-LS LSP --------------------
------------------------------------------------------ ------------------------------------------------------
local null_ls = require("null-ls") local none_ls = require("null-ls")
local eslintFiles = { local eslintFiles = {
".eslintrc", ".eslintrc",
@@ -202,29 +220,32 @@ local eslintFiles = {
"eslint.config.cts", "eslint.config.cts",
} }
has_eslint_in_parents = function(fname) local has_eslint_in_parents = function(fname)
root_file = nvim_lsp.util.insert_package_json(eslintFiles, "eslintConfig", fname) local root_file = require("lspconfig").util.insert_package_json(eslintFiles, "eslintConfig", fname)
return nvim_lsp.util.root_pattern(unpack(root_file))(fname) return require("lspconfig").util.root_pattern(unpack(root_file))(fname)
end end
null_ls.setup({ none_ls.setup({
sources = { sources = {
-- Prettier Formatting -- Prettier Formatting
null_ls.builtins.formatting.prettier, none_ls.builtins.formatting.prettier,
null_ls.builtins.formatting.prettier.with({ filetypes = { "template" } }), none_ls.builtins.formatting.prettier.with({ filetypes = { "template" } }),
require("none-ls.diagnostics.eslint_d").with({ require("none-ls.diagnostics.eslint_d").with({
condition = function(utils) condition = function(utils)
return has_eslint_in_parents(vim.fn.getcwd()) return has_eslint_in_parents(vim.fn.getcwd())
end, end,
}), }),
null_ls.builtins.completion.spell, none_ls.builtins.completion.spell,
null_ls.builtins.formatting.nixpkgs_fmt, none_ls.builtins.formatting.nixpkgs_fmt, -- TODO: nixd native LSP?
null_ls.builtins.formatting.stylua, none_ls.builtins.diagnostics.sqlfluff,
null_ls.builtins.diagnostics.sqlfluff, none_ls.builtins.formatting.sqlfluff,
null_ls.builtins.formatting.sqlfluff, require("none-ls.formatting.autopep8").with({
filetypes = { "starlark", "python" },
extra_args = { "--max-line-length", "100" },
}),
}, },
on_attach = function(client, bufnr) on_attach = function(client, bufnr)
if client.supports_method("textDocument/formatting") then if client:supports_method("textDocument/formatting") then
vim.api.nvim_clear_autocmds({ group = augroup, buffer = bufnr }) vim.api.nvim_clear_autocmds({ group = augroup, buffer = bufnr })
vim.api.nvim_create_autocmd("BufWritePre", { vim.api.nvim_create_autocmd("BufWritePre", {
group = augroup, group = augroup,

View File

@@ -1,2 +0,0 @@
require("lsp_lines").setup()
vim.diagnostic.config({virtual_text = false})

View File

@@ -3,23 +3,28 @@ local cached_pr_status = ""
-- Read process output -- Read process output
local function read_output(err, data) local function read_output(err, data)
if err then return end if err then
if not data then return end return
cached_pr_status = data end
if not data then
return
end
cached_pr_status = data
end end
-- Spawn process -- Spawn process
local function execute_command() local function execute_command()
local stdout = vim.loop.new_pipe(false) local stdout = vim.loop.new_pipe(false)
local spawn_opts = { local spawn_opts = {
detached = true, detached = true,
stdio = {nil, stdout, nil}, stdio = { nil, stdout, nil },
args = {"-c", "gh pr checks | awk -F'\t' '{ print $2 }'"} args = { "-c", "gh pr checks | awk -F'\t' '{ print $2 }'" },
} }
vim.loop.spawn("bash", spawn_opts, vim.loop.spawn("bash", spawn_opts, function()
function() stdout:read_start(read_output) end) stdout:read_start(read_output)
end)
end end
-- Spawn & schedule process -- Spawn & schedule process
@@ -27,23 +32,26 @@ execute_command()
vim.fn.timer_start(300000, execute_command) vim.fn.timer_start(300000, execute_command)
-- Return status from cache -- Return status from cache
function pr_status() local function pr_status()
--    --   
--     --    
-- --
-- PENDING COLOR - #d29922 -- PENDING COLOR - #d29922
-- PASS COLOR - #3fb950 -- PASS COLOR - #3fb950
-- FAIL COLOR - #f85149 -- FAIL COLOR - #f85149
return cached_pr_status:gsub("\n", ""):gsub("fail", ""):gsub("pass", return cached_pr_status
"") :gsub("\n", "")
:gsub("pending", " "):gsub("skipping", ""):sub(1, -2) :gsub("fail", " ")
:gsub("pass", "")
:gsub("pending", "")
:gsub("skipping", "")
:sub(1, -2)
end end
require('lualine').setup({ require("lualine").setup({
options = { options = { theme = "catppuccin" },
theme = "gruvbox_dark" sections = {
-- theme = "nord" lualine_c = { { pr_status } },
-- theme = "OceanicNext", -- lualine_z = { require("opencode").statusline }
}, },
sections = {lualine_c = {{pr_status}}}
}) })

View File

@@ -1,2 +0,0 @@
require("neo-tree").setup({ window = { mappings = { ["<space>"] = "none" } } })
vim.keymap.set("n", "<leader>t", ":Neotree toggle<CR>", { silent = true })

View File

@@ -1,26 +1,14 @@
-- Noice Doc Scrolling
vim.keymap.set("n", "<c-f>", function()
if not require("noice.lsp").scroll(4) then return "<c-f>" end
end, {silent = true, expr = true})
vim.keymap.set("n", "<c-b>", function()
if not require("noice.lsp").scroll(-4) then return "<c-b>" end
end, {silent = true, expr = true})
-- Noice Setup -- Noice Setup
require("noice").setup({ require("noice").setup({
lsp = { -- Ignore (Snacks Priority)
override = { routes = {
["vim.lsp.util.convert_input_to_markdown_lines"] = true, {
["vim.lsp.util.stylize_markdown"] = true, filter = { event = "ui", kind = "input", },
["cmp.entry.get_documentation"] = false opts = { skip = true },
}, },
signature = {enabled = false} {
}, filter = { event = "ui", kind = "select", },
presets = { opts = { skip = true },
command_palette = true, -- position the cmdline and popupmenu together },
long_message_to_split = true, -- long messages will be sent to a split },
inc_rename = false, -- enables an input dialog for inc-rename.nvim
lsp_doc_border = false -- add a border to hover docs and signature help
}
}) })

View File

@@ -0,0 +1,13 @@
require("octo").setup()
-- Create KeyMaps
vim.keymap.set("n", "<leader>rs", "<cmd>Octo review start<cr>")
vim.keymap.set("n", "<leader>rd", "<cmd>Octo review discard<cr>")
vim.keymap.set("n", "<leader>rr", "<cmd>Octo review resume<cr>")
vim.keymap.set("n", "<leader>re", "<cmd>Octo review submit<cr>")
vim.keymap.set("n", "<leader>rca", "<cmd>Octo review comments<cr>")
vim.keymap.set("n", "<leader>rcs", "<cmd>Octo comment suggest<cr>")
vim.keymap.set("n", "<leader>rcc", "<cmd>Octo comment add<cr>")
vim.keymap.set("n", "<leader>rcr", "<cmd>Octo comment reply<cr>")
vim.keymap.set("n", "<leader>pd", "<cmd>Octo pr diff<cr>")
vim.keymap.set("n", "<leader>pc", "<cmd>Octo pr changes<cr>")

View File

@@ -0,0 +1,71 @@
local progress = require("fidget.progress")
local M = {}
function M:init()
local group = vim.api.nvim_create_augroup("CodeCompanionFidgetHooks", {})
vim.api.nvim_create_autocmd({ "User" }, {
pattern = "CodeCompanionRequestStarted",
group = group,
callback = function(request)
local handle = M:create_progress_handle(request)
M:store_progress_handle(request.data.id, handle)
end,
})
vim.api.nvim_create_autocmd({ "User" }, {
pattern = "CodeCompanionRequestFinished",
group = group,
callback = function(request)
local handle = M:pop_progress_handle(request.data.id)
if handle then
M:report_exit_status(handle, request)
handle:finish()
end
end,
})
end
M.handles = {}
function M:store_progress_handle(id, handle)
M.handles[id] = handle
end
function M:pop_progress_handle(id)
local handle = M.handles[id]
M.handles[id] = nil
return handle
end
function M:create_progress_handle(request)
return progress.handle.create({
title = " Requesting assistance (" .. request.data.adapter.formatted_name .. ")",
message = "In progress...",
lsp_client = {
name = M:llm_role_title(request.data.adapter),
},
})
end
function M:llm_role_title(adapter)
local parts = {}
table.insert(parts, adapter.formatted_name)
if adapter.model and adapter.model ~= "" then
table.insert(parts, "(" .. adapter.model .. ")")
end
return table.concat(parts, " ")
end
function M:report_exit_status(handle, request)
if request.data.status == "success" then
handle.message = "Completed"
elseif request.data.status == "error" then
handle.message = " Error"
else
handle.message = "󰜺 Cancelled"
end
end
return M

View File

@@ -1,10 +0,0 @@
local silicon = require('silicon')
silicon.setup({})
vim.keymap.set('v', '<Leader>ss', function() silicon.visualise_api({}) end)
vim.keymap.set('v', '<Leader>sb',
function() silicon.visualise_api({show_buf = true}) end)
vim.keymap.set('n', '<Leader>sv',
function() silicon.visualise_api({visible = true}) end)
vim.keymap.set('n', '<Leader>sb',
function() silicon.visualise_api({show_buf = true}) end)

View File

@@ -0,0 +1,23 @@
-- Snacks Setup
local snacks = require("snacks")
snacks.setup({
input = { enabled = true, style = "popup" },
select = { enabled = true, style = "popup" },
})
-- Create KeyMaps
vim.keymap.set("n", "<leader>fb", snacks.picker.buffers, { desc = "Buffers" })
vim.keymap.set("n", "<leader>fd", snacks.picker.diagnostics, { desc = "Diagnostics" })
vim.keymap.set("n", "<leader>ff", snacks.picker.files, { desc = "Find Files" })
vim.keymap.set("n", "<leader>fg", snacks.picker.grep, { desc = "Grep Files" })
vim.keymap.set("n", "<leader>fh", snacks.picker.help, { desc = "Help Tags" })
vim.keymap.set("n", "<leader>fj", snacks.picker.jumps, { desc = "Jump List" })
vim.keymap.set("n", "<leader>fl", function() snacks.terminal("lazygit") end, { desc = "LazyGit" })
vim.keymap.set("n", "<leader>fp", snacks.picker.gh_pr, { desc = "GitHub Pull Requests" })
vim.keymap.set("n", "<leader>fs", snacks.picker.lsp_symbols, { desc = "Symbols" })
vim.keymap.set("n", "<leader>fu", snacks.picker.undo, { desc = "Undo History" })
vim.keymap.set("n", "gI", snacks.picker.lsp_implementations, { desc = "LSP Implementations" })
vim.keymap.set("n", "gi", snacks.picker.lsp_incoming_calls, { desc = "LSP Incoming Calls" })
vim.keymap.set("n", "go", snacks.picker.lsp_outgoing_calls, { desc = "LSP Outgoing Calls" })
vim.keymap.set("n", "gr", snacks.picker.lsp_references, { desc = "LSP References" })
vim.keymap.set("n", [[<c-\>]], function() snacks.terminal() end, { desc = "Toggle Terminal" })

View File

@@ -1,20 +0,0 @@
require('telescope').setup {
extensions = {
fzf = {
fuzzy = true,
override_generic_sorter = true,
override_file_sorter = true,
case_mode = "smart_case"
}
}
}
require('telescope').load_extension('fzf')
require("telescope").load_extension("ui-select")
local builtin = require('telescope.builtin')
vim.keymap.set('n', '<leader>ff', builtin.find_files, {})
vim.keymap.set('n', '<leader>fg', builtin.live_grep, {})
vim.keymap.set('n', '<leader>fb', builtin.buffers, {})
vim.keymap.set('n', '<leader>fh', builtin.help_tags, {})
vim.keymap.set('n', '<leader>fj', builtin.jumplist, {})

View File

@@ -1,20 +1,20 @@
require("toggleterm").setup({open_mapping = [[<c-\>]]}) -- require("toggleterm").setup({open_mapping = [[<c-\>]]})
--
-- Get PR status on terminal load -- -- Get PR status on terminal load
-- require("toggleterm").setup({ -- -- require("toggleterm").setup({
-- open_mapping = [[<c-\>]], -- -- open_mapping = [[<c-\>]],
-- on_create = function(term) -- -- on_create = function(term)
-- vim.cmd("startinsert") -- -- vim.cmd("startinsert")
-- term:send("gh pr checks") -- -- term:send("gh pr checks")
-- end -- -- end
-- }) -- -- })
--
-- Duplicate C-w & Esc Behavior -- -- Duplicate C-w & Esc Behavior
function _G.set_terminal_keymaps() -- function _G.set_terminal_keymaps()
local opts = {buffer = 0} -- local opts = {buffer = 0}
vim.opt.signcolumn = "no" -- vim.opt.signcolumn = "no"
vim.keymap.set('t', '<esc>', [[<C-\><C-n>]], opts) -- vim.keymap.set('t', '<esc>', [[<C-\><C-n>]], opts)
vim.keymap.set('t', '<C-w>', [[<C-\><C-n><C-w>]], opts) -- vim.keymap.set('t', '<C-w>', [[<C-\><C-n><C-w>]], opts)
end -- end
--
vim.cmd('autocmd! TermOpen term://* lua set_terminal_keymaps()') -- vim.cmd('autocmd! TermOpen term://* lua set_terminal_keymaps()')

View File

@@ -1,3 +1,4 @@
require'nvim-treesitter.configs'.setup { require("nvim-treesitter.configs").setup({
highlight = {enable = true, additional_vim_regex_highlighting = false} highlight = { enable = true, additional_vim_regex_highlighting = false },
} })
vim.treesitter.language.register("markdown", "octo")

View File

@@ -1,47 +1,9 @@
local wk = require("which-key") local wk = require("which-key")
wk.setup({})
wk.add({ wk.add({
{ "<C-k>", desc = "Signature Help" }, { "<leader>a", group = "LLM" }, -- llm-config.lua
{ "<leader>a", desc = "Aerial" }, { "<leader>f", group = "Find" }, -- snacks-config.lua
{ "<leader>d", group = "Debug" }, { "<leader>l", group = "LSP" }, -- lsp-config.lua
{ "<leader>db", desc = "Toggle Breakpoint" }, { "<leader>g", group = "Git" }, -- git-config.lua
{ "<leader>dc", desc = "Continue" }, { "<leader>q", group = "Diagnostics" }, -- diagnostics-config.lua
{ "<leader>dt", desc = "Run Test" }, { "<leader>d", group = "Debug" }, -- dap-config.lua
{ "<leader>du", desc = "Toggle UI" },
{ "<leader>f", group = "Find - Telescope" },
{ "<leader>fb", "<cmd>Telescope buffers<cr>", desc = "Find Buffer" },
{ "<leader>ff", "<cmd>Telescope find_files<cr>", desc = "Find File" },
{ "<leader>fg", "<cmd>Telescope live_grep<cr>", desc = "Live Grep" },
{ "<leader>fh", "<cmd>Telescope help_tags<cr>", desc = "Help Tags" },
{ "<leader>fj", "<cmd>Telescope jumplist<cr>", desc = "Jump List" },
{ "<leader>g", group = "DiffView" },
{ "<leader>gB", desc = "Git Blame Full" },
{ "<leader>gH", "<cmd>DiffviewFileHistory --range=origin..HEAD<cr>", desc = "Diff History - Main" },
{ "<leader>gO", "<cmd>DiffviewOpen origin/main...HEAD<cr>", desc = "Open Diff - Main" },
{ "<leader>gb", desc = "Git Blame Line" },
{ "<leader>gc", "<cmd>DiffviewClose<cr>", desc = "Close Diff" },
{ "<leader>gh", "<cmd>DiffviewFileHistory<cr>", desc = "Diff History" },
{ "<leader>go", "<cmd>DiffviewOpen<cr>", desc = "Open Diff - Current" },
{ "<leader>l", group = "LSP" },
{ "<leader>lD", desc = "Declaration" },
{ "<leader>ld", desc = "Definition" },
{ "<leader>lf", desc = "Format" },
{ "<leader>li", desc = "Implementation" },
{ "<leader>ln", desc = "Rename" },
{ "<leader>lr", desc = "References" },
{ "<leader>lt", desc = "Type Definition" },
{ "<leader>q", group = "Diagnostics" },
{ "<leader>qN", desc = "Previous Diagnostic" },
{ "<leader>qe", desc = "Open Diagnostic Float" },
{ "<leader>qn", desc = "Next Diagnostic" },
{ "<leader>qq", desc = "Toggle Diagnostic List" },
{ "<leader>qt", desc = "Toggle Inline Diagnostics" },
{ "<leader>sv", desc = "Visual Screenshot" },
{ "<leader>t", desc = "NeoTree" },
{ "K", desc = "Definition Hover" },
{ "<leader>ss", desc = "Selected Screenshot", mode = "v" },
{ "<leader>s", group = "Screenshot", mode = { "n", "v" } },
{ "<leader>sb", desc = "Buffer Screenshot", mode = { "n", "v" } },
}) })

View File

@@ -1,4 +1,9 @@
{ pkgs, lib, config, namespace, ... }: { pkgs
, lib
, config
, namespace
, ...
}:
let let
inherit (lib) mkIf; inherit (lib) mkIf;
cfg = config.${namespace}.programs.terminal.nvim; cfg = config.${namespace}.programs.terminal.nvim;
@@ -34,31 +39,29 @@ in
# ------------------- # -------------------
# ----- Helpers ----- # ----- Helpers -----
# ------------------- # -------------------
aerial-nvim # Code Outline
comment-nvim # Code Comments comment-nvim # Code Comments
copilot-vim # GitHub Copilot
diffview-nvim # Diff View diffview-nvim # Diff View
fidget-nvim # Notification Helper
gitsigns-nvim # Git Blame gitsigns-nvim # Git Blame
leap-nvim # Quick Movement leap-nvim # Quick Movement
markdown-preview-nvim # Markdown Preview markdown-preview-nvim # Markdown Preview
neo-tree-nvim # File Explorer
none-ls-nvim # Formatters none-ls-nvim # Formatters
numb-nvim # Peek / Jump to Lines numb-nvim # Peek / Jump to Lines
nvim-autopairs # Automatically Close Pairs (),[],{} nvim-autopairs # Automatically Close Pairs (),[],{}
telescope-fzf-native-nvim # Faster Telescope octo-nvim # Git Octo
render-markdown-nvim # Markdown Renderer
snacks-nvim # Snacks
telescope-nvim # Fuzzy Finder telescope-nvim # Fuzzy Finder
telescope-ui-select-nvim # UI
toggleterm-nvim # Terminal Helper
vim-nix # Nix Helpers vim-nix # Nix Helpers
which-key-nvim # Shortcut Helper which-key-nvim # Shortcut Helper
# ------------------ # ------------------
# --- Theme / UI --- # --- Theme / UI ---
# ------------------ # ------------------
catppuccin-nvim # Theme
lualine-nvim # Bottom Line lualine-nvim # Bottom Line
noice-nvim # UI Tweaks noice-nvim # UI Tweaks
# nord-nvim # Theme
# melange-nvim # Theme
catppuccin-nvim # Theme
nvim-notify # Noice Dependency nvim-notify # Noice Dependency
nvim-web-devicons # Dev Icons nvim-web-devicons # Dev Icons
@@ -75,83 +78,58 @@ in
nvim-dap-go nvim-dap-go
nvim-dap-ui nvim-dap-ui
# --------------------
# -- CODE COMPANION --
# --------------------
(pkgs.vimUtils.buildVimPlugin {
pname = "codecompanion.nvim";
version = "2025-12-20";
src = pkgs.fetchFromGitHub {
owner = "olimorris";
repo = "codecompanion.nvim";
rev = "a226ca071ebc1d8b5ae1f70800fa9cf4a06a2101";
sha256 = "sha256-F1nI7q98SPpDjlwPvGy/qFuHvlT1FrbQPcjWrBwLaHU=";
};
doCheck = false;
meta.homepage = "https://github.com/olimorris/codecompanion.nvim/";
meta.hydraPlatforms = [ ];
})
# -------------------- # --------------------
# -- NONE-LS EXTRAS -- # -- NONE-LS EXTRAS --
# -------------------- # --------------------
( (pkgs.vimUtils.buildVimPlugin {
pkgs.vimUtils.buildVimPlugin { pname = "none-ls-extras.nvim";
pname = "none-ls-extras.nvim"; version = "2025-10-28";
version = "2024-06-11"; src = pkgs.fetchFromGitHub {
src = pkgs.fetchFromGitHub { owner = "nvimtools";
owner = "nvimtools"; repo = "none-ls-extras.nvim";
repo = "none-ls-extras.nvim"; rev = "402c6b5c29f0ab57fac924b863709f37f55dc298";
rev = "336e84b9e43c0effb735b08798ffac382920053b"; sha256 = "sha256-4s/xQNWNA4dgb5gZR4Xqn6zDDWrSJNtmHOmmjmYnN/8=";
sha256 = "sha256-UtU4oWSRTKdEoMz3w8Pk95sROuo3LEwxSDAm169wxwk="; };
}; doCheck = false;
meta.homepage = "https://github.com/nvimtools/none-ls-extras.nvim/"; meta.homepage = "https://github.com/nvimtools/none-ls-extras.nvim/";
} })
)
# -------------------
# ----- Silicon -----
# -------------------
(
pkgs.vimUtils.buildVimPlugin {
pname = "silicon.lua";
version = "2022-12-03";
src = pkgs.fetchFromGitHub {
owner = "mhanberg";
repo = "silicon.lua";
rev = "5ca462bee0a39b058786bc7fbeb5d16ea49f3a23";
sha256 = "0vlp645d5mmii513v72jca931miyrhkvhwb9bfzhix1199zx7vi2";
};
meta.homepage = "https://github.com/mhanberg/silicon.lua/";
}
)
# -------------------
# ------- LLM -------
# -------------------
(
pkgs.vimUtils.buildVimPlugin {
pname = "llm.nvim";
version = "2024-05-25";
src = pkgs.fetchFromGitHub {
owner = "David-Kunz";
repo = "gen.nvim";
rev = "bd19cf584b5b82123de977b44105e855e61e5f39";
sha256 = "sha256-0AEB6im8Jz5foYzmL6KEGSAYo48g1bkFpjlCSWT6JeE=";
};
meta.homepage = "https://github.com/David-Kunz/gen.nvim/";
}
)
# ------------------- # -------------------
# ---- LLAMA.VIM ---- # ---- LLAMA.VIM ----
# ------------------- # -------------------
( (pkgs.vimUtils.buildVimPlugin {
pkgs.vimUtils.buildVimPlugin { pname = "llama.vim";
pname = "llama.vim"; version = "2025-10-28";
version = "2025-01-23"; src = pkgs.fetchFromGitHub {
src = pkgs.fetchFromGitHub { owner = "ggml-org";
owner = "ggml-org"; repo = "llama.vim";
repo = "llama.vim"; rev = "ade8966eff57dcbe4a359dd26fb1ea97378ea03c";
rev = "143fe910b8d47a054ed464c38d8b7c17d5354468"; sha256 = "sha256-uPqOZLWKVMimhc9eG7yM5OmhJy3mTRgKsiqKhstWs4Y=";
sha256 = "sha256-PW0HKzhSxcZiWzpDOuy98rl/X0o2nE7tMjZjwwh0qLE="; };
}; meta.homepage = "https://github.com/ggml-org/llama.vim/";
meta.homepage = "https://github.com/ggml-org/llama.vim/"; })
}
)
]; ];
extraPackages = with pkgs; [ extraPackages = with pkgs; [
# Telescope Dependencies # LSP
fd eslint_d
ripgrep
tree-sitter
# LSP Dependencies
go go
golangci-lint golangci-lint
golangci-lint-langserver golangci-lint-langserver
@@ -164,7 +142,7 @@ in
nodePackages.typescript-language-server nodePackages.typescript-language-server
nodePackages.vscode-langservers-extracted nodePackages.vscode-langservers-extracted
pyright pyright
eslint_d python312Packages.autopep8
# Formatters # Formatters
luaformatter luaformatter
@@ -173,8 +151,9 @@ in
sqlfluff sqlfluff
stylua stylua
# Silicon # Tools
silicon ripgrep
lazygit
]; ];
extraConfig = ":luafile ~/.config/nvim/lua/init.lua"; extraConfig = ":luafile ~/.config/nvim/lua/init.lua";
@@ -190,11 +169,14 @@ in
# Generate Nix Vars # Generate Nix Vars
"nvim/lua/nix-vars.lua".text = '' "nvim/lua/nix-vars.lua".text = ''
local nix_vars = { local nix_vars = {
bash = "${pkgs.bashInteractive}/bin/bash",
clangd = "${pkgs.clang-tools}/bin/clangd",
golintls = "${pkgs.golangci-lint-langserver}/bin/golangci-lint-langserver",
gopls = "${pkgs.gopls}/bin/gopls", gopls = "${pkgs.gopls}/bin/gopls",
luals = "${pkgs.lua-language-server}/bin/lua-language-server", luals = "${pkgs.lua-language-server}/bin/lua-language-server",
omnisharp = "${pkgs.omnisharp-roslyn}/bin/OmniSharp",
sveltels = "${pkgs.nodePackages.svelte-language-server}/bin/svelteserver", sveltels = "${pkgs.nodePackages.svelte-language-server}/bin/svelteserver",
tsls = "${pkgs.nodePackages.typescript-language-server}/bin/typescript-language-server", tsls = "${pkgs.nodePackages.typescript-language-server}/bin/typescript-language-server",
golintls = "${pkgs.golangci-lint-langserver}/bin/golangci-lint-langserver",
vscls = "${pkgs.nodePackages.vscode-langservers-extracted}", vscls = "${pkgs.nodePackages.vscode-langservers-extracted}",
} }
return nix_vars return nix_vars

View File

@@ -0,0 +1,81 @@
{ lib
, pkgs
, config
, namespace
, ...
}:
let
inherit (lib) mkIf;
cfg = config.${namespace}.programs.terminal.opencode;
in
{
options.${namespace}.programs.terminal.opencode = {
enable = lib.mkEnableOption "enable opencode";
};
config = mkIf cfg.enable {
programs.opencode = {
enable = true;
package = pkgs.reichard.opencode;
enableMcpIntegration = true;
settings = {
theme = "catppuccin";
model = "llama-swap/devstral-small-2-instruct";
permission = {
edit = "allow";
bash = "ask";
webfetch = "ask";
doom_loop = "ask";
external_directory = "ask";
};
lsp = {
nil = {
command = [
"${pkgs.nil}/bin/nil"
"--stdio"
];
extensions = [ ".nix" ];
};
};
provider = {
"llama-swap" = {
npm = "@ai-sdk/openai-compatible";
options = {
baseURL = "https://llm-api.va.reichard.io/v1";
};
models = {
gpt-oss-20b-thinking = {
name = "GPT OSS (20B)";
};
devstral-small-2-instruct = {
name = "Devstral Small 2 (24B)";
};
qwen3-coder-30b-instruct = {
name = "Qwen3 Coder (30B)";
};
qwen3-next-80b-instruct = {
name = "Qwen3 Next (80B) - Instruct";
};
qwen3-30b-2507-thinking = {
name = "Qwen3 2507 (30B) Thinking";
};
qwen3-30b-2507-instruct = {
name = "Qwen3 2507 (30B) Instruct";
};
};
};
};
mcp = {
gopls = {
type = "local";
command = [
"${pkgs.gopls}/bin/gopls"
"mcp"
];
enabled = true;
};
};
};
};
};
}

View File

@@ -0,0 +1,67 @@
{ lib
, pkgs
, config
, namespace
, ...
}:
let
inherit (lib) mkIf;
cfg = config.${namespace}.programs.terminal.tmux;
in
{
options.${namespace}.programs.terminal.tmux = {
enable = lib.mkEnableOption "tmux";
};
config = mkIf cfg.enable {
programs.tmux = {
enable = true;
clock24 = true;
plugins = with pkgs.tmuxPlugins; [
{
plugin = catppuccin;
extraConfig = ''
set -g @catppuccin_flavor "mocha"
set -g @catppuccin_status_background "none"
# Style & Separators
set -g @catppuccin_window_status_style "basic"
set -g @catppuccin_status_left_separator ""
set -g @catppuccin_status_middle_separator ""
set -g @catppuccin_status_right_separator ""
# Window Titles
set -g @catppuccin_window_text " #W"
set -g @catppuccin_window_current_text " #W"
'';
}
cpu
yank
];
extraConfig = ''
# Misc Settings
set -g status-position top
set -g mouse on
setw -g mode-keys vi
set -ag terminal-overrides ",xterm-256color:Tc:Ms=\\E]52;c%p1%.0s;%p2%s\\7"
# Start Index 1
set -g base-index 1
setw -g pane-base-index 1
set -g renumber-windows on
# Maintain Directory
bind '"' split-window -c "#{pane_current_path}"
bind % split-window -h -c "#{pane_current_path}"
bind c new-window -c "#{pane_current_path}"
# Theme
set -g status-left ""
set -g status-right ""
set -ag status-right "#{E:@catppuccin_status_host}"
'';
};
};
}

View File

@@ -0,0 +1,17 @@
{ config, lib, namespace, ... }:
let
inherit (lib) mkIf;
cfg = config.${namespace}.services.poweralertd;
in
{
options.${namespace}.services.poweralertd = {
enable = lib.mkEnableOption "poweralertd";
};
config = mkIf cfg.enable {
services.poweralertd = {
enable = true;
};
};
}

View File

@@ -28,14 +28,6 @@ in
keyFile = "${config.home.homeDirectory}/.config/sops/age/keys.txt"; keyFile = "${config.home.homeDirectory}/.config/sops/age/keys.txt";
sshKeyPaths = [ "${config.home.homeDirectory}/.ssh/id_ed25519" ] ++ cfg.sshKeyPaths; sshKeyPaths = [ "${config.home.homeDirectory}/.ssh/id_ed25519" ] ++ cfg.sshKeyPaths;
}; };
# TODO
# secrets = {
# nix = {
# sopsFile = lib.snowfall.fs.get-file "secrets/default.yaml";
# path = "${config.home.homeDirectory}/.config/nix/nix.conf";
# };
# };
}; };
}; };
} }

View File

@@ -0,0 +1,6 @@
{ pkgs, ... }:
{
environment.systemPackages = with pkgs; [
wget
];
}

View File

@@ -17,7 +17,8 @@ in
sddm = { sddm = {
inherit (cfg) enable; inherit (cfg) enable;
package = pkgs.kdePackages.sddm; package = pkgs.kdePackages.sddm;
theme = "catppuccin-mocha"; #theme = "catppuccin-mocha"; # https://github.com/nixos/nixpkgs/issues/434963
theme = "breeze";
wayland.enable = true; wayland.enable = true;
}; };
}; };

View File

@@ -0,0 +1,15 @@
{ config, lib, namespace, ... }:
let
inherit (lib) mkIf;
cfg = config.${namespace}.hardware.battery.upower;
in
{
options.${namespace}.hardware.battery.upower = {
enable = lib.mkEnableOption "enable upower";
};
config = mkIf cfg.enable {
services.upower.enable = true;
};
}

View File

@@ -14,15 +14,24 @@ in
}; };
config = mkIf cfg.enable { config = mkIf cfg.enable {
services.xserver.videoDrivers = mkIf cfg.enableNvidia [ "nvidia" ];
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
libva-utils libva-utils
vdpauinfo vdpauinfo
] ++ lib.optionals cfg.enableNvidia [ ] ++ lib.optionals (cfg.enableNvidia || cfg.enableIntel) [
nvtopPackages.full nvtopPackages.full
] ++ lib.optionals cfg.enableIntel [
intel-gpu-tools
]; ];
# Enable Nvidia Hardware
hardware.nvidia = mkIf cfg.enableNvidia {
package = config.boot.kernelPackages.nvidiaPackages.stable;
modesetting.enable = true;
powerManagement.enable = true;
open = false;
nvidiaSettings = true;
};
# Add Intel Arc / Nvidia Drivers # Add Intel Arc / Nvidia Drivers
hardware.enableRedistributableFirmware = mkIf cfg.enableIntel (mkForce true); hardware.enableRedistributableFirmware = mkIf cfg.enableIntel (mkForce true);
hardware.graphics = { hardware.graphics = {

View File

@@ -1,4 +1,4 @@
{ config, lib, namespace, ... }: { config, pkgs, lib, namespace, ... }:
let let
inherit (lib) mkIf; inherit (lib) mkIf;
@@ -17,6 +17,10 @@ in
}; };
}; };
environment.systemPackages = with pkgs; [
wl-clipboard
];
reichard = { reichard = {
display-managers = { display-managers = {
sddm = { sddm = {

View File

@@ -0,0 +1,51 @@
{ config, lib, namespace, ... }:
let
inherit (lib) mkIf mkEnableOption;
cfg = config.${namespace}.services.headscale;
inherit (lib.${namespace}) mkBoolOpt;
in
{
options.${namespace}.services.headscale = {
enable = mkEnableOption "enable headscale service";
openFirewall = mkBoolOpt false "Open firewall";
};
options.services.headscale.settings.dns.nameservers.split = lib.mkOption {
type = lib.types.attrsOf (lib.types.listOf lib.types.str);
default = { };
description = ''
Split DNS configuration mapping domains to specific nameservers.
Each key is a domain suffix, and the value is a list of nameservers
to use for that domain.
'';
example = {
"internal.company.com" = [ "10.0.0.1" "10.0.0.2" ];
"dev.local" = [ "192.168.1.1" ];
};
};
config = mkIf cfg.enable {
services.headscale = {
enable = true;
address = "0.0.0.0";
settings = {
server_url = "https://headscale.reichard.io";
dns = {
base_domain = "reichard.dev";
nameservers = {
global = [
"9.9.9.9"
];
split = {
"va.reichard.io" = [ "10.0.20.20" ];
};
};
};
};
};
networking.firewall = mkIf cfg.openFirewall {
allowedTCPPorts = [ 8080 ];
};
};
}

View File

@@ -0,0 +1,123 @@
{
config,
pkgs,
lib,
namespace,
...
}:
let
inherit (lib) types mkIf mkEnableOption;
inherit (lib.${namespace}) mkOpt;
cfg = config.${namespace}.services.llama-cpp;
modelDir = "/models";
availableModels = {
"qwen2.5-coder-7b-q8_0.gguf" = {
url = "https://huggingface.co/ggml-org/Qwen2.5-Coder-7B-Q8_0-GGUF/resolve/main/qwen2.5-coder-7b-q8_0.gguf?download=true";
flag = "--fim-qwen-7b-default";
};
"qwen2.5-coder-3b-q8_0.gguf" = {
url = "https://huggingface.co/ggml-org/Qwen2.5-Coder-3B-Q8_0-GGUF/resolve/main/qwen2.5-coder-3b-q8_0.gguf?download=true";
flag = "--fim-qwen-3b-default";
};
};
in
{
options.${namespace}.services.llama-cpp = with types; {
enable = mkEnableOption "llama-cpp support";
modelName = mkOpt str "qwen2.5-coder-3b-q8_0.gguf" "model to use";
};
config =
let
modelPath = "${modelDir}/${cfg.modelName}";
in
mkIf cfg.enable {
assertions = [
{
assertion = availableModels ? ${cfg.modelName};
message = "Invalid model '${cfg.modelName}'. Available models: ${lib.concatStringsSep ", " (lib.attrNames availableModels)}";
}
];
systemd.services = {
# LLama Download Model
download-model = {
description = "Download Model";
wantedBy = [ "multi-user.target" ];
before = [ "llama-cpp.service" ];
path = [
pkgs.curl
pkgs.coreutils
];
serviceConfig = {
Type = "oneshot";
RemainAfterExit = true;
User = "root";
Group = "root";
};
script =
let
modelURL = availableModels.${cfg.modelName}.url;
in
''
set -euo pipefail
if [ ! -f "${modelPath}" ]; then
mkdir -p "${modelDir}"
# Add -f flag to follow redirects and -L for location
# Add --fail flag to exit with error on HTTP errors
# Add -C - to resume interrupted downloads
curl -f -L -C - \
-H "Accept: application/octet-stream" \
--retry 3 \
--retry-delay 5 \
--max-time 1800 \
"${modelURL}" \
-o "${modelPath}.tmp" && \
mv "${modelPath}.tmp" "${modelPath}"
fi
'';
};
# Setup LLama API Service
llama-cpp = {
after = [ "download-model.service" ];
requires = [ "download-model.service" ];
};
};
services.llama-cpp = {
enable = true;
host = "0.0.0.0";
port = 8012;
openFirewall = true;
model = "${modelPath}";
package =
(pkgs.llama-cpp.override {
cudaSupport = true;
blasSupport = true;
rocmSupport = false;
metalSupport = false;
}).overrideAttrs
(oldAttrs: {
cmakeFlags = oldAttrs.cmakeFlags ++ [
"-DGGML_CUDA_ENABLE_UNIFIED_MEMORY=1"
"-DCMAKE_CUDA_ARCHITECTURES=61" # GTX-1070 / GTX-1080ti
"-DGGML_NATIVE=ON"
# Disable CPU Instructions - Intel(R) Core(TM) i5-3570K CPU @ 3.40GHz
# "-DLLAMA_FMA=OFF"
# "-DLLAMA_AVX2=OFF"
# "-DLLAMA_AVX512=OFF"
# "-DGGML_FMA=OFF"
# "-DGGML_AVX2=OFF"
# "-DGGML_AVX512=OFF"
];
});
extraFlags = [ availableModels.${cfg.modelName}.flag ];
};
};
}

View File

@@ -0,0 +1,18 @@
{ config, lib, namespace, ... }:
let
inherit (lib) mkIf;
cfg = config.${namespace}.services.mosh;
in
{
options.${namespace}.services.mosh = {
enable = lib.mkEnableOption "mosh support";
};
config = mkIf cfg.enable {
programs.mosh = {
enable = true;
openFirewall = true;
};
};
}

View File

@@ -1,4 +1,8 @@
{ config, lib, namespace, ... }: { config
, lib
, namespace
, ...
}:
let let
inherit (lib) inherit (lib)
types types
@@ -9,17 +13,23 @@ let
cfg = config.${namespace}.services.openssh; cfg = config.${namespace}.services.openssh;
authorizedKeys = [ globalKeys = [
# evanreichard@lin-va-mbp-personal # evanreichard@lin-va-mbp-personal
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAILJJoyXQOv9cAjGUHrUcvsW7vY9W0PmuPMQSI9AMZvNY" "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAILJJoyXQOv9cAjGUHrUcvsW7vY9W0PmuPMQSI9AMZvNY"
# evanreichard@mac-va-mbp-personal
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIMWj6rd6uDtHj/gGozgIEgxho/vBKebgN5Kce/N6vQWV"
# evanreichard@lin-va-thinkpad # evanreichard@lin-va-thinkpad
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIAq5JQr/6WJMIHhR434nK95FrDmf2ApW2Ahd2+cBKwDz" "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIAq5JQr/6WJMIHhR434nK95FrDmf2ApW2Ahd2+cBKwDz"
# evanreichard@lin-va-terminal
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIM5e6Cty+7rX5BjIEHBTU6GnzfOxPJiHpSqin/BnsypO"
# evanreichard@mobile
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIARTNbl4lgQsp7SJEng7vprL0+ChC9e6iR7o/PiC4Jme"
]; ];
in in
{ {
options.${namespace}.services.openssh = with types; { options.${namespace}.services.openssh = with types; {
enable = lib.mkEnableOption "OpenSSH support"; enable = lib.mkEnableOption "OpenSSH support";
authorizedKeys = mkOpt (listOf str) authorizedKeys "The public keys to apply."; authorizedKeys = mkOpt (listOf str) [ ] "The public keys to apply.";
extraConfig = mkOpt str "" "Extra configuration to apply."; extraConfig = mkOpt str "" "Extra configuration to apply.";
}; };
@@ -74,7 +84,7 @@ in
}; };
reichard = { reichard = {
user.extraOptions.openssh.authorizedKeys.keys = cfg.authorizedKeys; user.extraOptions.openssh.authorizedKeys.keys = cfg.authorizedKeys ++ globalKeys;
}; };
}; };
} }

View File

@@ -1,4 +1,9 @@
{ config, pkgs, lib, namespace, ... }: { config
, pkgs
, lib
, namespace
, ...
}:
let let
inherit (lib) types mkIf; inherit (lib) types mkIf;
inherit (lib.${namespace}) mkOpt mkBoolOpt; inherit (lib.${namespace}) mkOpt mkBoolOpt;
@@ -9,15 +14,25 @@ in
options.${namespace}.services.rke2 = with types; { options.${namespace}.services.rke2 = with types; {
enable = lib.mkEnableOption "Enable RKE2"; enable = lib.mkEnableOption "Enable RKE2";
disable = mkOpt (listOf str) [ ] "Disable services"; disable = mkOpt (listOf str) [ ] "Disable services";
openFirewall = mkBoolOpt true "Open firewall"; openFirewall = mkBoolOpt false "Open firewall";
}; };
config = mkIf cfg.enable { config = mkIf cfg.enable {
boot.kernel.sysctl = {
"fs.inotify.max_user_watches" = 1048576;
"fs.inotify.max_user_instances" = 8192;
"fs.file-max" = 2097152;
};
services.rke2 = { services.rke2 = {
enable = true; enable = true;
disable = cfg.disable; disable = cfg.disable;
}; };
# NOTE: Tailscale & K8s Calico conflict due to FWMask. You need to update the DaemonSet Env with:
# - name: FELIX_IPTABLESMARKMASK
# value: "0xff00ff00"
networking.firewall.allowedTCPPorts = mkIf cfg.openFirewall [ networking.firewall.allowedTCPPorts = mkIf cfg.openFirewall [
# RKE2 Ports - https://docs.rke2.io/install/requirements#networking # RKE2 Ports - https://docs.rke2.io/install/requirements#networking
6443 # Kubernetes API 6443 # Kubernetes API
@@ -32,8 +47,6 @@ in
7946 # memberlist 7946 # memberlist
]; ];
environment.systemPackages = with pkgs; [ nfs-utils ];
networking.firewall.allowedUDPPorts = mkIf cfg.openFirewall [ networking.firewall.allowedUDPPorts = mkIf cfg.openFirewall [
# RKE2 Ports - https://docs.rke2.io/install/requirements#networking # RKE2 Ports - https://docs.rke2.io/install/requirements#networking
8472 # Canal CNI with VXLAN 8472 # Canal CNI with VXLAN
@@ -49,5 +62,11 @@ in
after = [ "cloud-final.service" ]; after = [ "cloud-final.service" ];
requires = [ "cloud-final.service" ]; requires = [ "cloud-final.service" ];
}; };
environment.systemPackages = with pkgs; [
k9s
kubectl
nfs-utils
];
}; };
} }

View File

@@ -0,0 +1,32 @@
{ config, pkgs, lib, namespace, ... }:
let
inherit (lib) mkIf mkEnableOption;
inherit (lib.${namespace}) mkBoolOpt;
cfg = config.${namespace}.services.rtl-tcp;
in
{
options.${namespace}.services.rtl-tcp = {
enable = mkEnableOption "RTL-TCP support";
openFirewall = mkBoolOpt true "Open firewall";
};
config = mkIf cfg.enable {
hardware.rtl-sdr.enable = true;
networking.firewall.allowedTCPPorts = mkIf cfg.openFirewall [ 1234 ];
# RTL-SDR TCP Server Service
systemd.services.rtl-tcp = {
description = "RTL-SDR TCP Server";
after = [ "network.target" ];
wantedBy = [ "multi-user.target" ];
serviceConfig = {
ExecStart = "${pkgs.rtl-sdr}/bin/rtl_tcp -a 0.0.0.0 -f 1090000000 -s 2400000";
Restart = "on-failure";
RestartSec = "10s";
User = "root";
Group = "root";
};
};
};
}

View File

@@ -0,0 +1,20 @@
{ config, lib, namespace, ... }:
let
inherit (lib) mkIf mkEnableOption;
inherit (lib.${namespace}) mkBoolOpt;
cfg = config.${namespace}.services.sunshine;
in
{
options.${namespace}.services.sunshine = {
enable = mkEnableOption "enable sunshine service";
openFirewall = mkBoolOpt true "open firewall";
};
config = mkIf cfg.enable {
services.sunshine = {
enable = true;
openFirewall = cfg.openFirewall;
};
};
}

View File

@@ -0,0 +1,27 @@
{ config, lib, namespace, ... }:
let
inherit (lib) mkIf mkEnableOption;
cfg = config.${namespace}.services.tailscale;
in
{
options.${namespace}.services.tailscale = {
enable = mkEnableOption "enable tailscale service";
enableRouting = mkEnableOption "enable tailscale routing";
};
config = mkIf cfg.enable {
services.tailscale = {
enable = true;
useRoutingFeatures = if cfg.enableRouting then "server" else "client";
};
boot.kernel.sysctl = mkIf cfg.enableRouting {
"net.ipv4.ip_forward" = 1;
"net.ipv6.conf.all.forwarding" = 1;
};
# NOTE: Tailscale & K8s Calico conflict due to FWMask. You need to update the DaemonSet Env with:
# - name: FELIX_IPTABLESMARKMASK
# value: "0xff00ff00"
};
}

View File

@@ -1,18 +1,29 @@
{ config, lib, namespace, ... }: { config, lib, namespace, ... }:
let let
inherit (lib) mkIf mkDefault; inherit (lib) mkIf mkDefault;
inherit (lib.${namespace}) mkBoolOpt;
cfg = config.${namespace}.system.boot; cfg = config.${namespace}.system.boot;
in in
{ {
options.${namespace}.system.boot = { options.${namespace}.system.boot = {
enable = lib.mkEnableOption "Enable Boot"; enable = lib.mkEnableOption "Enable Boot";
xenGuest = lib.mkEnableOption "Enable Xen Guest"; enableGrub = mkBoolOpt true "Enable GRUB";
enableSystemd = mkBoolOpt false "Enable systemd";
xenGuest = lib.mkEnableOption "Xen guest support";
showNotch = lib.mkEnableOption "Show macOS Notch"; showNotch = lib.mkEnableOption "Show macOS Notch";
silentBoot = lib.mkEnableOption "Silent Boot"; silentBoot = lib.mkEnableOption "Silent Boot";
}; };
config = mkIf cfg.enable { config = mkIf cfg.enable {
assertions = [
{
assertion = !(cfg.enableGrub && cfg.enableSystemd);
message = "Cannot enable both GRUB and systemd-boot";
}
];
services.xe-guest-utilities.enable = mkIf cfg.xenGuest true; services.xe-guest-utilities.enable = mkIf cfg.xenGuest true;
boot = { boot = {
@@ -33,12 +44,18 @@ in
canTouchEfiVariables = false; canTouchEfiVariables = false;
}; };
systemd-boot = { systemd-boot = mkIf cfg.enableSystemd {
enable = true; enable = true;
configurationLimit = 20; configurationLimit = 20;
editor = false; editor = false;
}; };
grub = mkIf cfg.enableGrub {
enable = true;
efiSupport = true;
efiInstallAsRemovable = true;
};
timeout = mkDefault 1; timeout = mkDefault 1;
}; };

View File

@@ -20,22 +20,19 @@ in
content = { content = {
type = "gpt"; type = "gpt";
partitions = { partitions = {
bios-boot = {
name = "bios-boot";
size = "1M";
type = "EF02";
};
boot = { boot = {
size = "512M"; name = "boot";
size = "500M";
type = "EF00"; type = "EF00";
content = { content = {
type = "filesystem"; type = "filesystem";
format = "vfat"; format = "vfat";
mountpoint = "/boot"; mountpoint = "/boot";
mountOptions = [ "umask=0077" ];
};
};
root = {
size = "100%";
content = {
type = "filesystem";
format = "ext4";
mountpoint = "/";
}; };
}; };
swap = { swap = {
@@ -46,6 +43,33 @@ in
resumeDevice = true; resumeDevice = true;
}; };
}; };
root = {
name = "root";
size = "100%";
content = {
type = "lvm_pv";
vg = "pool";
};
};
};
};
};
};
lvm_vg = {
pool = {
type = "lvm_vg";
lvs = {
root = {
size = "100%FREE";
content = {
type = "filesystem";
format = "ext4";
mountpoint = "/";
mountOptions = [
"defaults"
];
};
}; };
}; };
}; };

View File

@@ -0,0 +1,55 @@
{ config, lib, pkgs, namespace, ... }:
let
inherit (lib) mkIf;
inherit (lib.${namespace}) mkBoolOpt;
cfg = config.${namespace}.virtualisation.libvirtd;
in
{
options.${namespace}.virtualisation.libvirtd = {
enable = lib.mkEnableOption "enable libvirtd";
withVirtManager = mkBoolOpt false "add virt-manager";
enableIntelIOMMU = mkBoolOpt false "enable Intel IOMMU for better device passthrough";
enableAMDIOMMU = mkBoolOpt false "enable AMD IOMMU for better device passthrough";
};
config = mkIf cfg.enable {
environment.systemPackages = with pkgs; [
virtio-win
virtiofsd
libvirt
qemu_kvm
] ++ lib.optionals cfg.withVirtManager [
virt-manager
virt-viewer
spice-gtk
];
reichard = {
user = {
extraGroups = [
"libvirtd"
];
};
};
virtualisation = {
libvirtd = {
enable = true;
qemu = {
package = pkgs.qemu_kvm;
runAsRoot = false;
swtpm.enable = true;
};
};
spiceUSBRedirection.enable = true;
};
boot.kernelParams = lib.optionals cfg.enableIntelIOMMU [
"intel_iommu=on"
] ++ lib.optionals cfg.enableAMDIOMMU [
"amd_iommu=on"
];
};
}

View File

@@ -1,4 +1,9 @@
{ config, lib, pkgs, namespace, ... }: { config
, lib
, pkgs
, namespace
, ...
}:
let let
inherit (lib) mkIf; inherit (lib) mkIf;

View File

@@ -0,0 +1,31 @@
# This patch modifies the json-schema-to-grammar.cpp file to handle 'not: {}' constructs
# specifically inside additionalProperties.
#
# Author: https://github.com/evanreichard
diff --git a/common/json-schema-to-grammar.cpp b/common/json-schema-to-grammar.cpp
index c3b4e5d..ea24bc3 100644
--- a/common/json-schema-to-grammar.cpp
+++ b/common/json-schema-to-grammar.cpp
@@ -858,10 +858,19 @@ public:
properties.emplace_back(prop.key(), prop.value());
}
}
+ json additionalProps = schema.contains("additionalProperties") ? schema["additionalProperties"] : json();
+ if (additionalProps.is_object() && additionalProps.contains("not")) {
+ const auto& not_val = additionalProps["not"];
+ if (not_val.is_object() && not_val.empty()) {
+ additionalProps.erase("not");
+ if (additionalProps.empty()) {
+ additionalProps = false;
+ }
+ }
+ }
return _add_rule(rule_name,
_build_object_rule(
- properties, required, name,
- schema.contains("additionalProperties") ? schema["additionalProperties"] : json()));
+ properties, required, name, additionalProps));
} else if ((schema_type.is_null() || schema_type == "object" || schema_type == "string") && schema.contains("allOf")) {
std::unordered_set<std::string> required;
std::vector<std::pair<std::string, json>> properties;

View File

@@ -0,0 +1,41 @@
{ pkgs }:
(pkgs.llama-cpp.override {
cudaSupport = true;
blasSupport = true;
rocmSupport = false;
metalSupport = false;
vulkanSupport = true;
}).overrideAttrs
(oldAttrs: rec {
version = "7562";
src = pkgs.fetchFromGitHub {
owner = "ggml-org";
repo = "llama.cpp";
tag = "b${version}";
hash = "sha256-yuTPj41B3YitRPrD6yV25ilrIxVKebPGSqdJMpVhUDg=";
leaveDotGit = true;
postFetch = ''
git -C "$out" rev-parse --short HEAD > $out/COMMIT
find "$out" -name .git -print0 | xargs -0 rm -rf
'';
};
# Auto CPU Optimizations
cmakeFlags = (oldAttrs.cmakeFlags or [ ]) ++ [
"-DGGML_CUDA_ENABLE_UNIFIED_MEMORY=1"
"-DCMAKE_CUDA_ARCHITECTURES=61;86" # GTX 1070 / GTX 1080ti / RTX 3090
];
# Disable Nix's march=native Stripping
preConfigure = ''
export NIX_ENFORCE_NO_NATIVE=0
${oldAttrs.preConfigure or ""}
'';
# Apply Patches
patchFlags = [ "-p1" ];
patches = (oldAttrs.patches or [ ]) ++ [
./oneof-not-unrecognized-schema.patch
./additionalprops-unrecognized-schema.patch
];
})

View File

@@ -0,0 +1,28 @@
# This patch modifies the json-schema-to-grammar.cpp file to handle 'not: {}' constructs.
#
# Author: https://github.com/simaotwx
# Reference: https://github.com/ggml-org/llama.cpp/issues/14227#issuecomment-3547740835
diff --git a/common/json-schema-to-grammar.cpp b/common/json-schema-to-grammar.cpp
index 478aa1be7..ec0b3b73e 100644
--- a/common/json-schema-to-grammar.cpp
+++ b/common/json-schema-to-grammar.cpp
@@ -822,7 +822,17 @@ public:
return _add_rule(rule_name, _resolve_ref(schema["$ref"]));
} else if (schema.contains("oneOf") || schema.contains("anyOf")) {
std::vector<json> alt_schemas = schema.contains("oneOf") ? schema["oneOf"].get<std::vector<json>>() : schema["anyOf"].get<std::vector<json>>();
- return _add_rule(rule_name, _generate_union_rule(name, alt_schemas));
+ std::vector<json> filtered_schemas;
+ for (const auto& alt : alt_schemas) {
+ if (alt.is_object() && alt.contains("not")) {
+ const auto& not_val = alt["not"];
+ if (not_val.is_object() && not_val.empty()) {
+ continue;
+ }
+ }
+ filtered_schemas.push_back(alt);
+ }
+ return _add_rule(rule_name, _generate_union_rule(name, filtered_schemas));
} else if (schema_type.is_array()) {
std::vector<json> schema_types;
for (const auto & t : schema_type) {

View File

@@ -0,0 +1,143 @@
{ lib
, stdenv
, buildGoModule
, fetchFromGitHub
, versionCheckHook
, callPackage
, nixosTests
,
}:
let
canExecute = stdenv.buildPlatform.canExecute stdenv.hostPlatform;
in
buildGoModule (finalAttrs: {
pname = "llama-swap";
version = "179";
src = fetchFromGitHub {
owner = "mostlygeek";
repo = "llama-swap";
tag = "v${finalAttrs.version}";
hash = "sha256-7iftF1KMz+2DUifRG/ESHcWXYsOJ3NiEF7oHuJKxmUE=";
# populate values that require us to use git. By doing this in postFetch we
# can delete .git afterwards and maintain better reproducibility of the src.
leaveDotGit = true;
postFetch = ''
cd "$out"
git rev-parse HEAD > $out/COMMIT
# '0000-00-00T00:00:00Z'
date -u -d "@$(git log -1 --pretty=%ct)" "+'%Y-%m-%dT%H:%M:%SZ'" > $out/SOURCE_DATE_EPOCH
find "$out" -name .git -print0 | xargs -0 rm -rf
'';
};
vendorHash = "sha256-XiDYlw/byu8CWvg4KSPC7m8PGCZXtp08Y1velx4BR8U=";
passthru.ui = callPackage ./ui.nix { llama-swap = finalAttrs.finalPackage; };
passthru.npmDepsHash = "sha256-RKPcMwJ0qVOgbTxoGryrLn7AW0Bfmv9WasoY+gw4B30=";
nativeBuildInputs = [
versionCheckHook
];
# required for testing
__darwinAllowLocalNetworking = true;
ldflags = [
"-s"
"-w"
"-X main.version=${finalAttrs.version}"
];
preBuild = ''
# ldflags based on metadata from git and source
ldflags+=" -X main.commit=$(cat COMMIT)"
ldflags+=" -X main.date=$(cat SOURCE_DATE_EPOCH)"
# copy for go:embed in proxy/ui_embed.go
cp -r ${finalAttrs.passthru.ui}/ui_dist proxy/
'';
excludedPackages = [
# regression testing tool
"misc/process-cmd-test"
# benchmark/regression testing tool
"misc/benchmark-chatcompletion"
]
++ lib.optionals (!canExecute) [
# some tests expect to execute `simple-something`; if it can't be executed
# it's unneeded
"misc/simple-responder"
];
checkFlags =
let
skippedTests = lib.optionals (stdenv.isDarwin && stdenv.isx86_64) [
# Fail only on x86_64-darwin intermittently
# https://github.com/mostlygeek/llama-swap/issues/320
"TestProcess_AutomaticallyStartsUpstream"
"TestProcess_WaitOnMultipleStarts"
"TestProcess_BrokenModelConfig"
"TestProcess_UnloadAfterTTL"
"TestProcess_LowTTLValue"
"TestProcess_HTTPRequestsHaveTimeToFinish"
"TestProcess_SwapState"
"TestProcess_ShutdownInterruptsHealthCheck"
"TestProcess_ExitInterruptsHealthCheck"
"TestProcess_ConcurrencyLimit"
"TestProcess_StopImmediately"
"TestProcess_ForceStopWithKill"
"TestProcess_StopCmd"
"TestProcess_EnvironmentSetCorrectly"
];
in
[ "-skip=^${builtins.concatStringsSep "$|^" skippedTests}$" ];
# some tests expect to execute `simple-something` and proxy/helpers_test.go
# checks the file exists
doCheck = canExecute;
preCheck = ''
mkdir build
ln -s "$GOPATH/bin/simple-responder" "./build/simple-responder_''${GOOS}_''${GOARCH}"
'';
postCheck = ''
rm "$GOPATH/bin/simple-responder"
'';
preInstall = ''
install -Dm444 -t "$out/share/llama-swap" config.example.yaml
'';
doInstallCheck = true;
versionCheckProgramArg = "-version";
passthru.tests.nixos = nixosTests.llama-swap;
meta = {
homepage = "https://github.com/mostlygeek/llama-swap";
changelog = "https://github.com/mostlygeek/llama-swap/releases/tag/${finalAttrs.src.tag}";
description = "Model swapping for llama.cpp (or any local OpenAPI compatible server)";
longDescription = ''
llama-swap is a light weight, transparent proxy server that provides
automatic model swapping to llama.cpp's server.
When a request is made to an OpenAI compatible endpoint, llama-swap will
extract the `model` value and load the appropriate server configuration to
serve it. If the wrong upstream server is running, it will be replaced
with the correct one. This is where the "swap" part comes in. The upstream
server is automatically swapped to the correct one to serve the request.
In the most basic configuration llama-swap handles one model at a time.
For more advanced use cases, the `groups` feature allows multiple models
to be loaded at the same time. You have complete control over how your
system resources are used.
'';
license = lib.licenses.mit;
mainProgram = "llama-swap";
maintainers = with lib.maintainers; [
jk
podium868909
];
};
})

View File

@@ -0,0 +1,25 @@
{ llama-swap
, buildNpmPackage
,
}:
buildNpmPackage (finalAttrs: {
pname = "${llama-swap.pname}-ui";
inherit (llama-swap) version src npmDepsHash;
postPatch = ''
substituteInPlace vite.config.ts \
--replace-fail "../proxy/ui_dist" "${placeholder "out"}/ui_dist"
'';
sourceRoot = "${finalAttrs.src.name}/ui";
# bundled "ui_dist" doesn't need node_modules
postInstall = ''
rm -rf $out/lib
'';
meta = (removeAttrs llama-swap.meta [ "mainProgram" ]) // {
description = "${llama-swap.meta.description} - UI";
};
})

View File

@@ -0,0 +1,33 @@
#!/usr/bin/env bun
import solidPlugin from "./node_modules/@opentui/solid/scripts/solid-plugin";
import fs from "fs";
const version = process.env.OPENCODE_VERSION!;
const channel = process.env.OPENCODE_CHANNEL!;
const result = await Bun.build({
target: "bun",
outdir: "./dist",
entrypoints: ["./src/index.ts", "./src/cli/cmd/tui/worker.ts"],
plugins: [solidPlugin],
naming: {
entry: "[dir]/[name].js",
},
define: {
OPENCODE_VERSION: JSON.stringify(version),
OPENCODE_CHANNEL: JSON.stringify(channel),
},
external: ["@opentui/core-*"],
});
if (!result.success) {
console.error("Bundle failed:", result.logs);
process.exit(1);
}
// Move worker file to worker.ts at the dist root so the code can find it
if (fs.existsSync("./dist/cli/cmd/tui/worker.js")) {
fs.renameSync("./dist/cli/cmd/tui/worker.js", "./dist/worker.ts");
fs.rmdirSync("./dist/cli/cmd/tui", { recursive: true });
}

View File

@@ -0,0 +1,227 @@
{ lib
, stdenvNoCC
, bun
, fetchFromGitHub
, fzf
, makeBinaryWrapper
, models-dev
, nix-update-script
, ripgrep
, testers
, writableTmpDirAsHomeHook
,
}:
let
pname = "opencode";
version = "1.0.170";
src = fetchFromGitHub {
owner = "sst";
repo = "opencode";
tag = "v${version}";
hash = "sha256-Y0thIZ20p0FSBAH0mJfFn8e+OEUvlZyTuk+/yEt8Sy8=";
};
node_modules = stdenvNoCC.mkDerivation {
pname = "${pname}-node_modules";
inherit version src;
impureEnvVars = lib.fetchers.proxyImpureEnvVars ++ [
"GIT_PROXY_COMMAND"
"SOCKS_SERVER"
];
nativeBuildInputs = [
bun
writableTmpDirAsHomeHook
];
dontConfigure = true;
buildPhase = ''
runHook preBuild
export BUN_INSTALL_CACHE_DIR=$(mktemp -d)
bun install \
--cpu="*" \
--filter=./packages/opencode \
--force \
--frozen-lockfile \
--ignore-scripts \
--no-progress \
--os="*" \
--production
bun run ./nix/scripts/canonicalize-node-modules.ts
bun run ./nix/scripts/normalize-bun-binaries.ts
runHook postBuild
'';
installPhase = ''
runHook preInstall
mkdir -p $out
while IFS= read -r dir; do
rel="''${dir#./}"
dest="$out/$rel"
mkdir -p "$(dirname "$dest")"
cp -R "$dir" "$dest"
done < <(find . -type d -name node_modules -prune | sort)
runHook postInstall
'';
# NOTE: Required else we get errors that our fixed-output derivation references store paths
dontFixup = true;
outputHash = "sha256-Aq774bgU12HkrF2oAtfu9kyQFlxUeDbmwlS9lz4Z4ZI=";
outputHashAlgo = "sha256";
outputHashMode = "recursive";
};
in
stdenvNoCC.mkDerivation (finalAttrs: {
inherit
pname
version
src
node_modules
;
nativeBuildInputs = [
bun
makeBinaryWrapper
models-dev
];
patches = [
# NOTE: Relax Bun version check to be a warning instead of an error
./relax-bun-version-check.patch
];
configurePhase = ''
runHook preConfigure
cp -R ${node_modules}/. .
runHook postConfigure
'';
env.MODELS_DEV_API_JSON = "${models-dev}/dist/_api.json";
env.OPENCODE_VERSION = finalAttrs.version;
env.OPENCODE_CHANNEL = "stable";
preBuild = ''
chmod -R u+w ./packages/opencode/node_modules
pushd ./packages/opencode/node_modules/@parcel/
for pkg in ../../../../node_modules/.bun/@parcel+watcher-*; do
linkName=$(basename "$pkg" | sed 's/@.*+\(.*\)@.*/\1/')
ln -sf "$pkg/node_modules/@parcel/$linkName" "$linkName"
done
popd
pushd ./packages/opencode/node_modules/@opentui/
for pkg in ../../../../node_modules/.bun/@opentui+core-*; do
linkName=$(basename "$pkg" | sed 's/@.*+\(.*\)@.*/\1/')
ln -sf "$pkg/node_modules/@opentui/$linkName" "$linkName"
done
popd
'';
buildPhase = ''
runHook preBuild
cd ./packages/opencode
cp ${./bundle.ts} ./bundle.ts
bun run ./bundle.ts
runHook postBuild
'';
dontStrip = true;
installPhase = ''
runHook preInstall
mkdir -p $out/lib/opencode
# Copy the bundled dist directory
cp -r dist $out/lib/opencode/
# Fix WASM paths in worker.ts - use absolute paths to the installed location
# Main wasm is tree-sitter-<hash>.wasm, language wasms are tree-sitter-<lang>-<hash>.wasm
main_wasm=$(find "$out/lib/opencode/dist" -maxdepth 1 -name 'tree-sitter-[a-z0-9]*.wasm' -print -quit)
substituteInPlace $out/lib/opencode/dist/worker.ts \
--replace-fail 'module2.exports = "../../../tree-sitter-' 'module2.exports = "'"$out"'/lib/opencode/dist/tree-sitter-' \
--replace-fail 'new URL("tree-sitter.wasm", import.meta.url).href' "\"$main_wasm\""
# Copy only the native modules we need (marked as external in bundle.ts)
mkdir -p $out/lib/opencode/node_modules/.bun
mkdir -p $out/lib/opencode/node_modules/@opentui
# Copy @opentui/core platform-specific packages
for pkg in ../../node_modules/.bun/@opentui+core-*; do
if [ -d "$pkg" ]; then
cp -r "$pkg" $out/lib/opencode/node_modules/.bun/$(basename "$pkg")
fi
done
mkdir -p $out/bin
makeWrapper ${lib.getExe bun} $out/bin/opencode \
--add-flags "run" \
--add-flags "$out/lib/opencode/dist/index.js" \
--prefix PATH : ${
lib.makeBinPath [
fzf
ripgrep
]
} \
--argv0 opencode
runHook postInstall
'';
postInstall = ''
# Add symlinks for platform-specific native modules
for pkg in $out/lib/opencode/node_modules/.bun/@opentui+core-*; do
if [ -d "$pkg" ]; then
pkgName=$(basename "$pkg" | sed 's/@opentui+\(core-[^@]*\)@.*/\1/')
ln -sf ../.bun/$(basename "$pkg")/node_modules/@opentui/$pkgName \
$out/lib/opencode/node_modules/@opentui/$pkgName
fi
done
'';
passthru = {
tests.version = testers.testVersion {
package = finalAttrs.finalPackage;
command = "HOME=$(mktemp -d) opencode --version";
inherit (finalAttrs) version;
};
updateScript = nix-update-script {
extraArgs = [
"--subpackage"
"node_modules"
];
};
};
meta = {
description = "AI coding agent built for the terminal";
longDescription = ''
OpenCode is a terminal-based agent that can build anything.
It combines a TypeScript/JavaScript core with a Go-based TUI
to provide an interactive AI coding experience.
'';
homepage = "https://github.com/sst/opencode";
license = lib.licenses.mit;
platforms = [
"aarch64-linux"
"x86_64-linux"
"aarch64-darwin"
"x86_64-darwin"
];
mainProgram = "opencode";
};
})

View File

@@ -0,0 +1,28 @@
From 0e07ea8225f5667e39c6aa59eea726266f0afab0 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= <joerg@thalheim.io>
Date: Thu, 13 Nov 2025 10:16:31 +0100
Subject: [PATCH] Change Bun version check from error to warning
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Signed-off-by: Jörg Thalheim <joerg@thalheim.io>
---
packages/script/src/index.ts | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/packages/script/src/index.ts b/packages/script/src/index.ts
index 141d2b75..de06d0dc 100644
--- a/packages/script/src/index.ts
+++ b/packages/script/src/index.ts
@@ -10,7 +10,7 @@ if (!expectedBunVersion) {
}
if (process.versions.bun !== expectedBunVersion) {
- throw new Error(`This script requires bun@${expectedBunVersion}, but you are using bun@${process.versions.bun}`)
+ console.warn(`Warning: This script expects bun@${expectedBunVersion}, but you are using bun@${process.versions.bun}`)
}
const CHANNEL = process.env["OPENCODE_CHANNEL"] ?? (await $`git branch --show-current`.text().then((x) => x.trim()))
--
2.51.0

View File

@@ -0,0 +1,91 @@
{ lib
, buildNpmPackage
, fetchFromGitHub
, jq
, git
, ripgrep
, pkg-config
, glib
, libsecret
, ...
}:
buildNpmPackage (finalAttrs: {
pname = "qwen-code";
version = "0.4.0-nightly.20251209.a6a57233";
src = fetchFromGitHub {
owner = "QwenLM";
repo = "qwen-code";
tag = "v${finalAttrs.version}";
hash = "sha256-s9m1IN6jDDbNPr/vI/UcrauYPiyQTDODarLP3EvnG3Y=";
};
npmDepsHash = "sha256-ngAjCCoHLPZ+GgBRmAKbRYaF7l+RK3YGf1kEkwFbyQg=";
nativeBuildInputs = [
jq
pkg-config
git
];
buildInputs = [
ripgrep
glib
libsecret
];
postPatch = ''
${jq}/bin/jq '
del(.packages."node_modules/node-pty") |
del(.packages."node_modules/@lydell/node-pty") |
del(.packages."node_modules/@lydell/node-pty-darwin-arm64") |
del(.packages."node_modules/@lydell/node-pty-darwin-x64") |
del(.packages."node_modules/@lydell/node-pty-linux-arm64") |
del(.packages."node_modules/@lydell/node-pty-linux-x64") |
del(.packages."node_modules/@lydell/node-pty-win32-arm64") |
del(.packages."node_modules/@lydell/node-pty-win32-x64") |
del(.packages."node_modules/keytar") |
walk(
if type == "object" and has("dependencies") then
.dependencies |= with_entries(select(.key | (contains("node-pty") | not) and (contains("keytar") | not)))
elif type == "object" and has("optionalDependencies") then
.optionalDependencies |= with_entries(select(.key | (contains("node-pty") | not) and (contains("keytar") | not)))
else .
end
) |
walk(
if type == "object" and has("peerDependencies") then
.peerDependencies |= with_entries(select(.key | (contains("node-pty") | not) and (contains("keytar") | not)))
else .
end
)
' package-lock.json > package-lock.json.tmp && mv package-lock.json.tmp package-lock.json
'';
buildPhase = ''
runHook preBuild
npm run generate
npm run bundle
runHook postBuild
'';
installPhase = ''
runHook preInstall
mkdir -p $out/bin $out/share/qwen-code
cp -r dist/* $out/share/qwen-code/
npm prune --production
cp -r node_modules $out/share/qwen-code/
find $out/share/qwen-code/node_modules -type l -delete || true
patchShebangs $out/share/qwen-code
ln -s $out/share/qwen-code/cli.js $out/bin/qwen
runHook postInstall
'';
meta = {
description = "Coding agent that lives in digital world";
homepage = "https://github.com/QwenLM/qwen-code";
mainProgram = "qwen";
license = lib.licenses.asl20;
platforms = lib.platforms.all;
};
})

View File

@@ -0,0 +1,26 @@
builder_ssh_key: ENC[AES256_GCM,data:1cYuaFJke/8GyqxPKp2zH/uARvW6Bqx6AsB16U8f3WkDpnxO6kym19MpDyQUBEjJ9Bj3RiBkSSL96jBv4YZfq+1cN8D6E14faKoYF5FZy5o1C+aTl+4L9zbrQIl/QDFh42qcJ6cYsOSjbEJv8kvZQBV7l+LNo8ZX07f76Kld3boouJJMMZWa9oaZgEifTxN4yDOPXTXNjCO3blGnsm+V3FPkba+EUASL9WH6+XLU2oW1Bc/sydOTiKGRJcs5eyqYvKi3evtxUUyqgdPVtUHNTsh6/B5kDLWFavfEfchPHT0LHIuqGJwGBglTp/NJThAoo5vNFAFIAUw9QWlY4alHhsi2L5g49r3s6i+3fGeyGCTP61uffY9HgF7nOdkTVMsRXacKh9fwgdsZAepcU+kJ3LJSdOaa4hUtCsZpFHUe4jA0kTHI1/V+7ak+iw92gNZTLKsCjIOzWFvEBVSXLctPdxQ8ezvF9ekvw5mkAwO7QYonlrQ3MUY/8b1DDOdjmfSwEyrLruew2KajFhm8/NM/2BOwcO/y+DbX2MSe5x0sx4HN79E=,iv:V25Tc7bOxc4wl5lf6gZOstN1InaCb3sfpCHMl65iwn8=,tag:mBFZcX2G3vpAOMw7V12d6w==,type:str]
rke2_kubeconfig: ENC[AES256_GCM,data:oTOBktUE71QNJXqy8l5hhYKF3mSQlLxXE7rjsctyJi4nIk4bhKACGdYkB8B37Ws9QHm5h9tAn9J/ehbWyBwsOFQIhX7S0kov8/HPlatbY3aJ+PiHO5GWRkJjbq+GZrJgdGeOCSRlA5C4lOy9cYbCqbsgfp42cNxOPhOQUyqFNCmsWJvBiJDuQX3Sqk2QoDtfTayho/v5IiJ9Xjms6m1ng98uXmANHK2wFAv4IZ2+7j14jy5RRKylTtjooJxTalSzdODV4wufHOLqFRCeGs9U4A/SEbRWacssdTWOp/wkaumruEpbuRaX33EwFzAxnawD0T/PBA1w9MfrXoz7bYaQ8S0fpWQHTr7xj79yrlJslBvTp/SzC+7LlpdsOtJr/2LpbzwFowMFPOGg0XJUWlkevIIObBuEYyAnlytxlys+2UNx+szOuUsUDTdZlEtTyJT+Xp8WjFlXkHsi66s+rDxDvUcMG6oLy3IYiYA4D7Q65aDgiy87kDmdfItf5koEEpHU2wV20EtAP2mRZ8UNYnDHd3ZV1L2gLXHGMA/sa0Tn0l4fhfr+6K0niQ9RaZxrVfqyChCw4bSCyZZFajZXcEDXsQB5UKsnMmZ3p5ZtRe/mqKydAz/xQc8mZPYFWwXN3uWgOWLRraRib0thg/PQzsbGNrKxoqc0sY3JbUSBcyhtz2x7b0Sj+g8ibtySmSEM1DrcYFdLG/QHbg8MaSOIIlZDDan2SJ0vAd432hI9BBIxj3L0EOfVBkbzEdtuuW7SSCG650X2u4Rd0Kkjc7HoB6pafJTWx2QZ/CMKIZFiHfMJ1zRyxco7SwZzsTRZ1Y0W7qgnssKpqtRNwCfRTdDM/6aZ1HorNP2NombuyGmfvD/EZSt4xxsOZIgioqfghbcsTCFZQPUvfBSZvJ5KBXS8qacBmsUxMLRMyzSbq0mM/S9Rz8oUxN587K7pLTNNiwFsQ9mXlGgh//rzhdAfzQZF/uuMrjqYgxt3iOAT3Nd34RbZ8YK31SRf6lFy7b+hafS1FFVUnW8jnC57eo2wNpHFBNA1y60dokx9P1dzZUVVYK5iCK+QFkUweD9WSo0al09E3By2pQxZ1OS9UOcTxFbpP/WakD57/tkOvmGIirqrexVecDcODelGXhCVeXb8zJQDz2PdXz3M4G0zIV2JcgJDjJy91Rx56vxRQv0/mvPfjexm9gQcTWOpIeUOBGRCfMXMh0g0AANHxDheRa9WzYQ10uDE3DsyMT53+FGW73PyPBk5MzRY/RQXjTEVbhO/e8Km7KOuhRxpohcLHCugEFMqjsW/c5b6GU24s3n69XPxMWtdtMmnf1FaGGufuOXyYd2s1vQqi+542x41HYnXiT6OQwsFttnlbwfrosl9qgSSgsfwXNv7qHQUBDg1KczwlPBZ3cMA/rQUqHL2N4vEp00JoJFjBTbWrin2FCOBafQmpKPv9j/nqiJROr3I93bSaodk0rFOUDWV3Sp/YepeuYb6wY+lMgysg4jDuJxEYQytFfNI2SBd7g4Xh6vBW/GS1/JdaHhh/Ub5/Cqa0Pxl5fBjV1HQIaM8mXi+V90zRVqzKm9vl9wXjXzAk8QvWRiW5ruP3IsMl5myL1KBuFIgZNPkbv8Nap3XDgmO2IvM6gWI3LHW81cgS6dDcsuC2C9zr291MAlYQiaotqQ33u0ga/y8DTXB3mcLTPLpkWWRY+Cc+qVAuD3LwCvd2StUhxUNwDbwVaxtuSk+uWMx1PCPPwHDVB3sm93wbnKrvj0TMHdkh0im+KzSplaMAsCgKJj1YO3Yhjg+E9CwIaYEDKcCE8FNqioSzzaXABQgpa4zUWkWC+D4iD/kSS3Z+BgB0VCytB705SMbmHmAlWnNayFgQLx3xo/TkgF51jEghj2w2gPyTM8gLqq8kvpXnDx95nhfStRu3KZCuCZKadrv0V5mSCCSzw0STDKZjfwYHHMWOnf41UDG7M9+vWHdtZdnJjLvw8gIqmLl0fkw75jFXYXQaNj4vh6MNSp7ABA8wY5Ala/EckHjx9R88czgyvHTLfVOiFgIiOLvldSYmDlaMcyPTVH7JSTiSoZ7aUwNROQE0/C9GyvZH8MGN9Iy6YQAUQYf5jjesoe3dPJf66GmeCKKlAcO1aK91XXow+pWrYJBZilhXJgPNTKltP2ObDLeJ/30KYF7Gee9GvtJaKzBGjYFZZz9nj8ixIBymS+M7N65U8Sw+/37qCnkSDe6VgkMoXXijaPgfToR4yb6FdZOqRlvynbyC+lSO44l2S1CkKbUxrqzZX2pQ6iB1eJdaHmIBYawVg7tJOO3snPXYMiMAgmojrH1BUUpbQRRvG4BTrUOES4N+2etytiZ7N4GEDzshosVaf9NeFBWRGC58siec/BtKwo7HGcsc0zDvcq8MFJ6rEUDbuZuWn3+CvxC9fi4+CzDP3j3K9lOUiXJ6vxv+1eImFMVgQUiV4g2M/JMTv6+Ix8U9dHoaNVjQlnL1NZRo92C/T2WRx42V97hJOe81CXqRLY8mW30MXat7KK+n92bNsWTKZrNsKnzVb+i1YwMAiwG1bw0OCcmfVojozZ4wjUNkFJI2K0v0CCvwVIl9yUKMkCvo+I1m2ZInOXRme2HK82YFg6JxitlQvovdlUndN1Lo4PhaxbW3BNwJSn81FxJ4yh+d34eawZlsQ4l+er2CyWrXSOvQnK1F8UwDB5xgPb8TBj5FD4IZM+op2LPQiaPQZ7bShzpN20W413lBvauirbD8EaZqt2QExmDnYHs1EMcj10bvu7IyKwZTlBqOa/LpyUH/imY4DTB0aYHby+xnLX7760S0sJfKuJ7omQ4QBgz+NSZ/aFfPicugkPsCZI0lS9WCcczvHgbFRzB6YQ5uJEoK5o5SdVTpYWUBvuLbJ6IOKNKWxlBcrsj4aPm+AAsxRc9cHPbrCns6y01K2wCYCL5nzK7jnneQiR4edtfnwMlUoo3c6/vzwiof4EVVrN29QxVsIA/9yqk375mKlI/l7/eOf083Kbad215wvZ+0U7cgI0oaaVvapj3Ni3e3Es8XUIQCua5HRE6d4M6A7P+Ye1Wkt+8oTpKJzd9Hn/ITwCYVssdpMSwF2ARHgmTtq+sacvkR9gojG/LAJMUwA48Sc4M5rn+5vTCRTvuKXDFphLSUwNzqd58YENC/HJjZS8+co+BN7AaafrybfA0QQrXkY7f+elsAFmNfho+taMpkfQZCmmgfoHPVPYR0pxkV1czCymm5lTjgkC7e4ydngcyJSrUzrXrWREkEcEdXoSRt1/JHABKRbvRuTbuUlah1xS1pvffosnA7KJL+aTLErkWwww3WUPMRrvmhVlWZqHGqE8lCRyMUPny7li3I2IB+aHFXepYwZSMMQPIOIiE19Oz7MsaIrMknqfTtdc58McEPGUPKiVO8x+nfRQPY45jFF60XtiK+yemYDicUGMSkWdtVLXgDCD+KAJz5YzBl5YbnPD9L1X9pB8P0vEpnKC6X+GGiaPflVGiNAKRTUyVv8CJ+Yh+KEfJw8og/P6d/7dSKheBeAdaliigZ9qG8xfyY0jE++xedaxIcOBObBu6j70j+Tpp5bUPN25FyVR2GqG4xz5YbuhnrRjhA6lAh0nppPlP+Oz/j9pPvPaDGESLZ/WM6MWru7R8DrHePBtulRvhvwUsmrjosPXuCNGU4sd1MFh6kNyyJH3W1quy3IopUij0Amu40mmd8XEzsN2nmT2Eh3NCd/r/2yj/t+xwxNcQZ+bfxeMFOiEfX5RU2paKNrRIDUEbgR1rS8A3PEUPTxwTP10IuY+IMToCSgZkVIq7UjXg0Bx9QdwvXcN74ADwkD0Un5+jLf4mo43QacwnBLpm24XqDzO09vKOzA9XU5fdC6AJ4mqAJ5J/XU8bC1RWiSCul6NekoJAPVgMlpWTPCAdSrWeYoE0d7lVkl+g+nEIS4sb,iv:mC5XSWReVzjwheF1IzCzp34JRvL/vJipyaKhptkH+cU=,tag:SDoNiaWaPKzruj+HPv5jbw==,type:str]
sops:
age:
- recipient: age1sac93wpnjcv62s7583jv6a4yspndh6k0r25g3qx3k7gq748uvafst6nz4w
enc: |
-----BEGIN AGE ENCRYPTED FILE-----
YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBuVWFObG51K2lTYlZidXBU
aW55RnpkVDExbVBkNDl4NkV3MFNkNThjbWdZCklhWkVSaWpPSE1VY09iWGlPVE9Q
bW1SY05jK3BwcDIwSHdMZjJHdWQyQkkKLS0tIHZYS2c2U2xtQ1QxajlKeWpmNXZW
bmdpcTl2NjRWM3F3Q2RHbk1rTEFvZEkKWag1nmqFZMRjwFtIo6oqs+9UI/Mer5bK
Ax7P7uwoZdiMN2g84W1pNTjj6GktFn3jrBaE+MxY6NUBr02apkRYZw==
-----END AGE ENCRYPTED FILE-----
- recipient: age1dccte7xtwswgef089nd80dutp96xnezx5lrqnneh9cusegsnda8sj3dj6c
enc: |
-----BEGIN AGE ENCRYPTED FILE-----
YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSB5cURST1FTbVk4RGZTaitF
MEt3Z2U0a004Zmo0VG1BN29DUnBLNGxPMEJFCkcyL1JrMkZsSTM5WCtZSldSeGZw
SmdpV3AxRDJyVW1WMXBuclhBSDkvTXcKLS0tIDZsU2pBbEFHNkdqWW1CZW1hdVN3
eW9OdlJmS21IVDNVNk9OMjZBT21PUTAK+lpsdEp2uvg8nFWu/hPtK0+Ahi5J//5d
NB6JJ7lwRWKy2NppFf9sy20Y1Z0Z5Ui40nbnURRzYgtsqbKBveUDcA==
-----END AGE ENCRYPTED FILE-----
lastmodified: "2025-07-29T23:30:28Z"
mac: ENC[AES256_GCM,data:x3dnanNbIX0fippbbFqOSR9ptZGdAwWuyn7hf3z6i43rk8Nk9p9EVqmE4/Guz2QY2tG/cph/5/nwX4UCO4ixAdB7pAWZa6lI1JdFzMBfW1IGeXOLyprDt6xdFnCVXjy64HgNWiVOPUS4+olxNZ0LPmCof7odqn+Axj+icFK3N34=,iv:OyFac4TxnKXwJ0l7LcJTqVyl11gIpw8fvEAEQTrEBc0=,tag:zMOGwIwAZmel+4EIqy9/tQ==,type:str]
unencrypted_suffix: _unencrypted
version: 3.10.2

View File

@@ -0,0 +1,29 @@
{ pkgs, ... }:
let
sync-repo = pkgs.writeShellScriptBin "sync-repo" ''
if [ -z "$1" ]; then
echo "Usage: sync-repo <ip-address>"
echo "Example: sync-repo 23.29.118.42"
exit 1
fi
rsync -av \
--exclude='.git' \
--exclude='.direnv' \
--exclude='_scratch' \
. evanreichard@$1:/etc/nixos
'';
in
pkgs.mkShell {
name = "reichard-dev";
buildInputs = with pkgs; [
rsync
sync-repo
];
shellHook = ''
echo "Use: sync-repo <ip-address> to sync repository"
'';
}

View File

@@ -0,0 +1,21 @@
{ lib, ... }:
{
system.stateVersion = 6;
nix.enable = false;
# System Config
reichard = {
nix = {
enable = true;
usingDeterminate = true;
};
security = {
sops = {
enable = true;
sshKeyPaths = [ "/etc/ssh/ssh_host_ed25519_key" ];
defaultSopsFile = lib.snowfall.fs.get-file "secrets/mac-va-mbp-personal/default.yaml";
};
};
};
}

View File

@@ -0,0 +1,55 @@
{ namespace
, config
, pkgs
, lib
, modulesPath
, ...
}:
let
inherit (lib.${namespace}) enabled;
cfg = config.${namespace}.user;
in
{
imports = [
(modulesPath + "/profiles/qemu-guest.nix")
];
system.stateVersion = "25.11";
time.timeZone = "UTC";
boot.loader.grub = {
efiSupport = true;
efiInstallAsRemovable = true;
};
reichard = {
nix = enabled;
system = {
disk = {
enable = true;
diskPath = "/dev/sda";
};
networking = enabled;
};
services = {
openssh = enabled;
headscale = {
enable = true;
openFirewall = true;
};
tailscale = {
enable = true;
enableRouting = true;
};
};
};
environment.systemPackages = with pkgs; [
btop
tmux
vim
];
}

View File

@@ -0,0 +1,50 @@
{ namespace
, pkgs
, lib
, modulesPath
, ...
}:
let
inherit (lib.${namespace}) enabled;
in
{
imports = [
(modulesPath + "/profiles/qemu-guest.nix")
];
system.stateVersion = "25.11";
time.timeZone = "UTC";
boot.loader.grub = {
efiSupport = true;
efiInstallAsRemovable = true;
};
reichard = {
nix = enabled;
system = {
disk = {
enable = true;
diskPath = "/dev/sda";
};
networking = {
enable = true;
};
};
services = {
openssh = enabled;
tailscale = {
enable = true;
enableRouting = true;
};
};
};
environment.systemPackages = with pkgs; [
btop
tmux
vim
];
}

View File

@@ -7,7 +7,7 @@ in
./hardware-configuration.nix ./hardware-configuration.nix
]; ];
system.stateVersion = "24.11"; system.stateVersion = "25.11";
time.timeZone = "America/New_York"; time.timeZone = "America/New_York";
# System Config # System Config

View File

@@ -0,0 +1,53 @@
{ namespace
, config
, pkgs
, lib
, modulesPath
, ...
}:
let
inherit (lib.${namespace}) enabled;
cfg = config.${namespace}.user;
in
{
imports = [
(modulesPath + "/profiles/qemu-guest.nix")
];
system.stateVersion = "25.11";
time.timeZone = "UTC";
boot.loader.grub = {
efiSupport = true;
efiInstallAsRemovable = true;
};
reichard = {
nix = enabled;
system = {
disk = {
enable = true;
diskPath = "/dev/sda";
};
networking = {
enable = true;
};
};
services = {
openssh = enabled;
tailscale = {
enable = true;
enableRouting = true;
};
};
};
environment.systemPackages = with pkgs; [
btop
tmux
vim
];
}

View File

@@ -0,0 +1,58 @@
{ namespace
, config
, pkgs
, lib
, modulesPath
, ...
}:
let
inherit (lib.${namespace}) enabled;
cfg = config.${namespace}.user;
in
{
imports = [
(modulesPath + "/profiles/qemu-guest.nix")
];
system.stateVersion = "25.11";
time.timeZone = "UTC";
networking.firewall.allowedTCPPorts = [ 443 ];
boot.loader.grub = {
efiSupport = true;
efiInstallAsRemovable = true;
};
reichard = {
nix = enabled;
system = {
disk = {
enable = true;
diskPath = "/dev/sda";
};
networking = enabled;
};
services = {
openssh = enabled;
tailscale = {
enable = true;
enableRouting = true;
};
rke2 = {
enable = true;
openFirewall = false;
disable = [ "rke2-ingress-nginx" ];
};
};
};
environment.systemPackages = with pkgs; [
btop
tmux
vim
];
}

View File

@@ -0,0 +1,63 @@
{ namespace
, pkgs
, lib
, modulesPath
, ...
}:
let
inherit (lib.${namespace}) enabled;
in
{
imports = [
(modulesPath + "/profiles/qemu-guest.nix")
];
system.stateVersion = "25.11";
time.timeZone = "UTC";
networking.firewall.allowedTCPPorts = [ 443 ];
boot.loader.grub = {
efiSupport = true;
efiInstallAsRemovable = true;
};
reichard = {
nix = enabled;
system = {
disk = {
enable = true;
diskPath = "/dev/sda";
};
networking = {
enable = true;
useStatic = {
interface = "enp3s0";
address = "23.29.118.42";
defaultGateway = "23.29.118.1";
nameservers = [ "1.1.1.1" ];
};
};
};
services = {
openssh = enabled;
tailscale = {
enable = true;
enableRouting = true;
};
rke2 = {
enable = true;
openFirewall = false;
disable = [ "rke2-ingress-nginx" ];
};
};
};
environment.systemPackages = with pkgs; [
btop
tmux
vim
];
}

View File

@@ -0,0 +1,340 @@
{ namespace
, pkgs
, lib
, ...
}:
let
inherit (lib.${namespace}) enabled;
in
{
system.stateVersion = "25.11";
time.timeZone = "America/New_York";
hardware.nvidia-container-toolkit.enable = true;
security.pam.loginLimits = [
{
domain = "*";
type = "soft";
item = "memlock";
value = "unlimited";
}
{
domain = "*";
type = "hard";
item = "memlock";
value = "unlimited";
}
];
nixpkgs.config.allowUnfree = true;
fileSystems."/mnt/ssd" = {
device = "/dev/disk/by-id/ata-Samsung_SSD_870_EVO_1TB_S6PTNZ0R620739L-part1";
fsType = "exfat";
options = [
"uid=1000"
"gid=100"
"umask=0022"
];
};
networking.firewall = {
allowedTCPPorts = [ 8081 ];
};
# System Config
reichard = {
nix = enabled;
system = {
boot = {
enable = true;
silentBoot = true;
enableSystemd = true;
enableGrub = false;
};
disk = {
enable = true;
diskPath = "/dev/sdc";
};
networking = {
enable = true;
useStatic = {
interface = "enp3s0";
address = "10.0.20.100";
defaultGateway = "10.0.20.254";
nameservers = [ "10.0.20.20" ];
};
};
};
hardware = {
opengl = {
enable = true;
enableNvidia = true;
};
};
services = {
openssh = enabled;
mosh = enabled;
};
virtualisation = {
podman = enabled;
};
};
systemd.services.llama-swap.serviceConfig.LimitMEMLOCK = "infinity";
services.llama-swap = {
enable = true;
openFirewall = true;
package = pkgs.reichard.llama-swap;
settings = {
models = {
# https://huggingface.co/unsloth/Devstral-Small-2-24B-Instruct-2512-GGUF/tree/main
"devstral-small-2-instruct" = {
name = "Devstral Small 2 (24B) - Instruct";
cmd = ''
${pkgs.reichard.llama-cpp}/bin/llama-server \
--port ''${PORT} \
-m /mnt/ssd/Models/Devstral/Devstral-Small-2-24B-Instruct-2512-UD-Q4_K_XL.gguf \
--chat-template-file /mnt/ssd/Models/Devstral/Devstral-Small-2-24B-Instruct-2512-UD-Q4_K_XL_template.jinja \
--temp 0.15 \
-c 98304 \
-ctk q8_0 \
-ctv q8_0 \
-fit off \
-dev CUDA0
'';
};
# https://huggingface.co/mradermacher/gpt-oss-20b-heretic-v2-i1-GGUF/tree/main
# --chat-template-kwargs '{\"reasoning_effort\":\"low\"}'
"gpt-oss-20b-thinking" = {
name = "GPT OSS (20B) - Thinking";
cmd = ''
${pkgs.reichard.llama-cpp}/bin/llama-server \
--port ''${PORT} \
-m /mnt/ssd/Models/GPT-OSS/gpt-oss-20b-F16.gguf \
-c 131072 \
--temp 1.0 \
--top-p 1.0 \
--top-k 40 \
-dev CUDA0
'';
};
# https://huggingface.co/mradermacher/GPT-OSS-Cybersecurity-20B-Merged-i1-GGUF/tree/main
"gpt-oss-csec-20b-thinking" = {
name = "GPT OSS CSEC (20B) - Thinking";
cmd = ''
${pkgs.reichard.llama-cpp}/bin/llama-server \
--port ''${PORT} \
-m /mnt/ssd/Models/GPT-OSS/GPT-OSS-Cybersecurity-20B-Merged.i1-MXFP4_MOE.gguf \
-c 131072 \
--temp 1.0 \
--top-p 1.0 \
--top-k 40 \
-dev CUDA0
'';
};
# https://huggingface.co/unsloth/Qwen3-Next-80B-A3B-Instruct-GGUF/tree/main
"qwen3-next-80b-instruct" = {
name = "Qwen3 Next (80B) - Instruct";
cmd = ''
${pkgs.reichard.llama-cpp}/bin/llama-server \
--port ''${PORT} \
-m /mnt/ssd/Models/Qwen3/Qwen3-Next-80B-A3B-Instruct-UD-Q2_K_XL.gguf \
-c 262144 \
--temp 0.7 \
--min-p 0.0 \
--top-p 0.8 \
--top-k 20 \
--repeat-penalty 1.05 \
-ctk q8_0 \
-ctv q8_0 \
-fit off
'';
};
# https://huggingface.co/unsloth/Qwen3-30B-A3B-Instruct-2507-GGUF/tree/main
"qwen3-30b-2507-instruct" = {
name = "Qwen3 2507 (30B) - Instruct";
cmd = ''
${pkgs.reichard.llama-cpp}/bin/llama-server \
--port ''${PORT} \
-m /mnt/ssd/Models/Qwen3/Qwen3-30B-A3B-Instruct-2507-Q4_K_M.gguf \
-c 262144 \
--temp 0.7 \
--min-p 0.0 \
--top-p 0.8 \
--top-k 20 \
--repeat-penalty 1.05 \
-ctk q8_0 \
-ctv q8_0 \
-ts 70,30
'';
};
# https://huggingface.co/unsloth/Qwen3-Coder-30B-A3B-Instruct-GGUF/tree/main
"qwen3-coder-30b-instruct" = {
name = "Qwen3 Coder (30B) - Instruct";
cmd = ''
${pkgs.reichard.llama-cpp}/bin/llama-server \
--port ''${PORT} \
-m /mnt/ssd/Models/Qwen3/Qwen3-Coder-30B-A3B-Instruct-Q4_K_M.gguf \
-c 262144 \
--temp 0.7 \
--min-p 0.0 \
--top-p 0.8 \
--top-k 20 \
--repeat-penalty 1.05 \
-ctk q8_0 \
-ctv q8_0 \
-ts 70,30
'';
};
# https://huggingface.co/unsloth/Qwen3-30B-A3B-Thinking-2507-GGUF/tree/main
"qwen3-30b-2507-thinking" = {
name = "Qwen3 2507 (30B) - Thinking";
cmd = ''
${pkgs.reichard.llama-cpp}/bin/llama-server \
--port ''${PORT} \
-m /mnt/ssd/Models/Qwen3/Qwen3-30B-A3B-Thinking-2507-UD-Q4_K_XL.gguf \
-c 262144 \
--temp 0.7 \
--min-p 0.0 \
--top-p 0.8 \
--top-k 20 \
--repeat-penalty 1.05 \
-ctk q8_0 \
-ctv q8_0 \
-ts 70,30
'';
};
# https://huggingface.co/unsloth/Nemotron-3-Nano-30B-A3B-GGUF/tree/main
"nemotron-3-nano-30b-thinking" = {
name = "Nemotron 3 Nano (30B) - Thinking";
cmd = ''
${pkgs.reichard.llama-cpp}/bin/llama-server \
--port ''${PORT} \
-m /mnt/ssd/Models/Nemotron/Nemotron-3-Nano-30B-A3B-UD-Q4_K_XL.gguf \
-c 1048576 \
--temp 1.1 \
--top-p 0.95 \
-fit off
'';
};
# https://huggingface.co/unsloth/Qwen3-VL-8B-Instruct-GGUF/tree/main
"qwen3-8b-vision" = {
name = "Qwen3 Vision (8B) - Thinking";
cmd = ''
${pkgs.reichard.llama-cpp}/bin/llama-server \
--port ''${PORT} \
-m /mnt/ssd/Models/Qwen3/Qwen3-VL-8B-Instruct-UD-Q4_K_XL.gguf \
--mmproj /mnt/ssd/Models/Qwen3/Qwen3-VL-8B-Instruct-UD-Q4_K_XL_mmproj-F16.gguf \
-c 65536 \
--temp 0.7 \
--min-p 0.0 \
--top-p 0.8 \
--top-k 20 \
-ctk q8_0 \
-ctv q8_0 \
-fit off \
-dev CUDA1
'';
};
# https://huggingface.co/unsloth/Qwen2.5-Coder-7B-Instruct-128K-GGUF/tree/main
"qwen2.5-coder-7b-instruct" = {
name = "Qwen2.5 Coder (7B) - Instruct";
cmd = ''
${pkgs.reichard.llama-cpp}/bin/llama-server \
-m /mnt/ssd/Models/Qwen2.5/Qwen2.5-Coder-7B-Instruct-Q8_0.gguf \
--fim-qwen-7b-default \
-c 131072 \
--port ''${PORT} \
-dev CUDA1
'';
};
# https://huggingface.co/unsloth/Qwen2.5-Coder-3B-Instruct-128K-GGUF/tree/main
"qwen2.5-coder-3b-instruct" = {
name = "Qwen2.5 Coder (3B) - Instruct";
cmd = ''
${pkgs.reichard.llama-cpp}/bin/llama-server \
-m /mnt/ssd/Models/Qwen2.5/Qwen2.5-Coder-3B-Instruct-Q8_0.gguf \
--fim-qwen-3b-default \
--port ''${PORT} \
-fit off \
-dev CUDA1
'';
};
# https://huggingface.co/unsloth/Qwen3-4B-Instruct-2507-GGUF/tree/main
"qwen3-4b-2507-instruct" = {
name = "Qwen3 2507 (4B) - Instruct";
cmd = ''
${pkgs.reichard.llama-cpp}/bin/llama-server \
--port ''${PORT} \
-m /mnt/ssd/Models/Qwen3/Qwen3-4B-Instruct-2507-Q4_K_M.gguf \
-c 98304 \
-fit off \
-ctk q8_0 \
-ctv q8_0 \
-dev CUDA1
'';
};
};
groups = {
shared = {
swap = true;
exclusive = true;
members = [
"nemotron-3-nano-30b-thinking"
"qwen3-30b-2507-instruct"
"qwen3-30b-2507-thinking"
"qwen3-coder-30b-instruct"
"qwen3-next-80b-instruct"
];
};
cuda0 = {
swap = true;
exclusive = false;
members = [
"devstral-small-2-instruct"
"gpt-oss-20b-thinking"
"gpt-oss-csec-20b-thinking"
];
};
cuda1 = {
swap = true;
exclusive = false;
members = [
"qwen2.5-coder-3b-instruct"
"qwen2.5-coder-7b-instruct"
"qwen3-4b-2507-instruct"
"qwen3-8b-vision"
];
};
};
};
};
# System Packages
environment.systemPackages = with pkgs; [
btop
git
tmux
vim
reichard.llama-cpp
];
}

Some files were not shown because too many files have changed in this diff Show More