Skip to content

Commit

Permalink
zsh aichat
Browse files Browse the repository at this point in the history
  • Loading branch information
Thomashighbaugh committed Jan 2, 2025
1 parent 9d54342 commit 87bf41b
Show file tree
Hide file tree
Showing 9 changed files with 90 additions and 45 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/todo.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Create issues from TODOs

on:
workflow_dispatch:
inputs:
importAll:
default: true
required: true
type: boolean
description: Enable, if you want to import all TODOs. Runs on checked out branch! Only use if you're sure what you are doing.
push:
branches: # do not set multiple branches, todos might be added and then get referenced by themselves in case of a merge
- main
- master

permissions:
issues: write
repository-projects: read
contents: read

jobs:
todos:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- name: Run Issue Bot
uses: derjuulsn/todo-issue@main
with:
excludePattern: '^(node_modules/)'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5 changes: 2 additions & 3 deletions home/shared/programs/aichat.nix
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
#markdown
''
---
model: "ollama:llama3.2:3b"
model: ollama:llama3.2:3b
temperature:
top_p:
---
Expand All @@ -29,7 +29,7 @@
#markdown
''
---
model: ollama:"Code Qwen 2.5"
model: ollama:Qwen 2.5 Coder
temperature:
top_p:
---
Expand All @@ -47,5 +47,4 @@ in {
xdg.configFile."aichat/roles/english.md".text = englishRole;
xdg.configFile."aichat/roles/commit.md".text = builtins.readFile ./aichat/commit.md;
xdg.configFile."aichat/roles/commitSuggester.md".text = commitSuggesterRole;

}
79 changes: 46 additions & 33 deletions home/shared/shell/zsh.nix
Original file line number Diff line number Diff line change
Expand Up @@ -50,40 +50,53 @@
# Create the completion cache directory
initExtra = ''
mkdir -p "${config.xdg.cacheHome}/zsh/completion-cache" # Use xdg directory for cache
# Completion & Completion Menu Oprions
# :completion:<function>:<completer>:<command>:<argument>:<tag>
zstyle ':completion:*' completer _complete _ignored _approximate
zstyle ':completion:*' complete true
zstyle ':completion:*' complete-options true
zstyle ':completion:*' file-sort modification
zstyle ':completion:*' group-name '''
zstyle ':completion:*' keep-prefix true
zstyle ':completion:*' list-colors ''${(s.:.)LS_COLORS}
zstyle ':completion:*' matcher-list 'm:{a-zA-Z}={A-Za-z}' 'r:|[._-]=* r:|=*' 'l:|=* r:|=*'
zstyle ':completion:*' menu select
zstyle ':completion:*' verbose true
zstyle ':completion:*:default' list-prompt '%S%M matches%s'
zstyle ':completion:*:corrections' format '%F{yellow}!- %d (errors: %e) -!%f'
zstyle ':completion:*:descriptions' format '%F{blue}-- %D %d --%f'
zstyle ':completion:*:messages' format ' %F{purple} -- %d --%f'
zstyle ':completion:*:warnings' format ' %F{red}-- no matches found --%f'
zstyle ':completion:*:*:-command-:*:*' group-order aliases builtins functions commands
zstyle ':completion:*' use-cache on
zstyle ':completion:*' cache-path "${config.xdg.cacheHome}/zsh/completion-cache" # Use xdg directory for cache
# ┣━━━━━━━━━━━━━━━━━━━━━━━━━┫ Functions ┣━━━━━━━━━━━━━━━━━━━━━━━━━┫
# walk tui file management and navigation
function lk {
cd "$(walk --icons "$@")"
mkdir -p "${config.xdg.cacheHome}/zsh/completion-cache" # Use xdg directory for cache
# Completion & Completion Menu Oprions
# :completion:<function>:<completer>:<command>:<argument>:<tag>
zstyle ':completion:*' completer _complete _ignored _approximate
zstyle ':completion:*' complete true
zstyle ':completion:*' complete-options true
zstyle ':completion:*' file-sort modification
zstyle ':completion:*' group-name '''
zstyle ':completion:*' keep-prefix true
zstyle ':completion:*' list-colors ''${(s.:.)LS_COLORS}
zstyle ':completion:*' matcher-list 'm:{a-zA-Z}={A-Za-z}' 'r:|[._-]=* r:|=*' 'l:|=* r:|=*'
zstyle ':completion:*' menu select
zstyle ':completion:*' verbose true
zstyle ':completion:*:default' list-prompt '%S%M matches%s'
zstyle ':completion:*:corrections' format '%F{yellow}!- %d (errors: %e) -!%f'
zstyle ':completion:*:descriptions' format '%F{blue}-- %D %d --%f'
zstyle ':completion:*:messages' format ' %F{purple} -- %d --%f'
zstyle ':completion:*:warnings' format ' %F{red}-- no matches found --%f'
zstyle ':completion:*:*:-command-:*:*' group-order aliases builtins functions commands
zstyle ':completion:*' use-cache on
zstyle ':completion:*' cache-path "${config.xdg.cacheHome}/zsh/completion-cache" # Use xdg directory for cache
# ┣━━━━━━━━━━━━━━━━━━━━━━━━━┫ Functions ┣━━━━━━━━━━━━━━━━━━━━━━━━━┫
# walk tui file management and navigation
function lk {
cd "$(walk --icons "$@")"
}
_aichat_zsh() {
if [[ -n "$BUFFER" ]]; then
local _old=$BUFFER
BUFFER+="⌛"
zle -I && zle redisplay
BUFFER=$(aichat -e "$_old")
zle end-of-line
fi
}
zle -N _aichat_zsh
bindkey '\ee' _aichat_zsh
'';
Expand Down
3 changes: 1 addition & 2 deletions hosts/bagalamukhi/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,7 @@
"nvidia_drm.fbdev=1" # Framebuffer driver
"nvidia-drm.modeset=1" # Modesetting Kernel Module
# Potentially useful for hanging or shutdown
"reboot=acpi"

"reboot=acpi"
];

loader = {
Expand Down
6 changes: 3 additions & 3 deletions hosts/bagalamukhi/nvidia.nix
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ in {
GBM_BACKEND = "nvidia-drm";
LIBVA_DRIVER_NAME = "nvidia"; # hardware acceleration
# __GLX_VENDOR_LIBRARY_NAME = "nvidia";
CUDA_PATH = "${pkgs.cudatoolkit}";
EXTRA_LDFLAGS = "-L/lib -L${pkgs.linuxPackages.nvidia_x11}/lib";
EXTRA_CCFLAGS = "-I/usr/include";
CUDA_PATH = "${pkgs.cudatoolkit}";
EXTRA_LDFLAGS = "-L/lib -L${pkgs.linuxPackages.nvidia_x11}/lib";
EXTRA_CCFLAGS = "-I/usr/include";
};
systemPackages = with pkgs; [
cudatoolkit
Expand Down
2 changes: 1 addition & 1 deletion hosts/shared/performance/undervolt.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
}: {
# Also done with the "advanced" BIOS setting to limit a
# amount of current that the CPU can request (default was no limit!)
# Doubling up to insure system functionality
# Doubling up to insure system functionality
services.undervolt = {
enable = true;
coreOffset = -100;
Expand Down
2 changes: 1 addition & 1 deletion hosts/shared/pkgs/system.nix
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ with pkgs; [
deer
didyoumean
efibootmgr
ghostty
ghostty
fd
ghostscript
gh
Expand Down
3 changes: 2 additions & 1 deletion hosts/shared/virtualization/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,13 @@
docker = {
enable = true;
enableOnBoot = true;
rootless.enable = true;
extraOptions = "--add-runtime nvidia=/run/current-system/sw/bin/nvidia-container-runtime";
};
libvirtd.enable = true;
};
hardware.nvidia-container-toolkit.enable = true;

hardware.graphics.enable32Bit = true;
environment.systemPackages = with pkgs; [
appvm
conmon
Expand Down
2 changes: 1 addition & 1 deletion shell.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
default = pkgs.mkShell {
# Enable experimental features without having to specify the argument
NIX_CONFIG = "experimental-features = recursive-nix ca-derivations nix-command flakes";
nativeBuildInputs = with pkgs; [nixVersions.git libcs50 gcc alejandra home-manager git neovim silver-searcher];
nativeBuildInputs = with pkgs; [nixVersions.git libcs50 gcc alejandra home-manager git neovim silver-searcher];
};
}

0 comments on commit 87bf41b

Please sign in to comment.