Skip to content

Commit

Permalink
Merge pull request #24 from chrishrb/feature/switch-from-copilot-to-o…
Browse files Browse the repository at this point in the history
…llama

Feature/switch from copilot to ollama
  • Loading branch information
chrishrb authored Sep 14, 2024
2 parents 94e1efc + a6e1484 commit 140354f
Show file tree
Hide file tree
Showing 16 changed files with 413 additions and 227 deletions.
76 changes: 38 additions & 38 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@
url = "github:nvim-neotest/nvim-nio";
flake = false;
};
copilot-chat-nvim = {
url = "github:CopilotC-Nvim/CopilotChat.nvim";
parrot-nvim = {
url = "github:frankroeder/parrot.nvim";
flake = false;
};

Expand Down
47 changes: 47 additions & 0 deletions hosts/macbook-christoph/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# The mw config
# System configuration for my work macbook

{ inputs, globals, overlays, ... }:

inputs.darwin.lib.darwinSystem {
system = "aarch64-darwin";
specialArgs = { inherit inputs; };
modules = [
../../modules/common
../../modules/darwin
(globals // {
user = "christophherb";
})
inputs.home-manager.darwinModules.home-manager
inputs.nix-homebrew.darwinModules.nix-homebrew
inputs.mac-app-util.darwinModules.default
{
nixpkgs.overlays = overlays;

# Darwin specific
networking.hostName = "macbook-christoph";

# Turn on all features related to desktop and graphical apps
gui.enable = true;

# Programs and services
alacritty.enable = true;
chrisNvim.enable = true;
dotfiles.enable = true;
drawio.enable = true;
chrome.enable = true;

# languaages
python.enable = true;
lua.enable = true;
devops.enable = true;
go.enable = true;
java.enable = false;
web.enable = true;
ai.enable = true;
discord.enable = true;
latex.enable = false;
nixlang.enable = true;
}
];
}
15 changes: 4 additions & 11 deletions modules/common/nvim/README.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,11 @@
<br />
<div align="center">
<a href="#">
<img src=".github/assets/nix-nvim.png" alt="Logo" height="80">
</a>
</div>

## Getting started

```bash
nix run github:chrishrb/nix-nvim
nix run github:chrishrb/nix-dots#nvim
```

## Setup Copilot
## Setup AI (avante, cmp, code-gemma)

1. Enable `ai` in `flake.nix`
2. Start `chrisNvim` and run `:Copilot auth`
3. Have fun using copilot in cmp and `:CopilotChat`, ..
2. Start ollama: `ollama run codegemma`
3. Have fun using local codegemma in cmp and `:Avante`, ..
13 changes: 6 additions & 7 deletions modules/common/nvim/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,9 @@ let
(forEachSystem (
system:
let
dependencyOverlays = (import ./overlays inputs) ++ [
dependencyOverlays = [
(utils.standardPluginOverlay inputs)
(import ./overlays inputs)
# add any flake overlays here.
#inputs.neorg-overlay.overlays.default
# inputs.neovim-nightly-overlay.overlays.default
Expand Down Expand Up @@ -89,11 +90,11 @@ let
nvim-dap
nvim-dap-ui
nvim-dap-virtual-text
pkgs.nixCatsBuilds.nvim-nio
nvim-nio
];
ai = with pkgs.vimPlugins; [
copilot-lua
pkgs.nixCatsBuilds.copilot-chat-nvim
parrot-nvim
fzf-lua
];
general = with pkgs.vimPlugins; {
theme = builtins.getAttr packageDef.categories.colorscheme {
Expand Down Expand Up @@ -131,8 +132,6 @@ let

cmp-under-comparator
cmp-spell

copilot-cmp
];
core = [
plenary-nvim
Expand All @@ -154,7 +153,7 @@ let
mkdir-nvim
bigfile-nvim
];
custom = with pkgs.nixCatsBuilds; [
custom = with pkgs.vimPlugins; [
nvim-tmux-navigation
gx-nvim
];
Expand Down
1 change: 0 additions & 1 deletion modules/common/nvim/lua/chrishrb/config/icons.lua
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ return {
Unit = "",
Value = "",
Variable = "",
Copilot = "",
},
git = {
LineAdded = "",
Expand Down
5 changes: 0 additions & 5 deletions modules/common/nvim/lua/chrishrb/plugins/config/cmp.lua
Original file line number Diff line number Diff line change
Expand Up @@ -73,14 +73,11 @@ cmp.setup {
nvim_lsp = "[LSP]",
buffer = "[Buffer]",
path = "[Path]",
copilot = "[Copilot]",
})[entry.source.name]
return vim_item
end,
},
sources = {
-- copilot
{ name = "copilot" },
-- other
{ name = "nvim_lsp" },
{ name = "luasnip" },
Expand All @@ -103,8 +100,6 @@ cmp.setup {
sorting = {
priority_weight = 2,
comparators = {
require("copilot_cmp.comparators").prioritize,

-- Below is the default comparitor list and order for nvim-cmp
cmp.config.compare.offset,
-- cmp.config.compare.scopes, --this is commented in nvim-cmp too
Expand Down
Loading

0 comments on commit 140354f

Please sign in to comment.