Skip to content

Commit

Permalink
chore: use helix from nixpkgs, remove helix copilot fork, use lsp-ai
Browse files Browse the repository at this point in the history
  • Loading branch information
johnae committed Sep 8, 2024
1 parent ff00185 commit 5e1bf08
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 66 deletions.
31 changes: 0 additions & 31 deletions flake.lock

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

5 changes: 0 additions & 5 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,6 @@
flake-utils.inputs.systems.follows = "systems";
fluxcd-install.flake = false;
fluxcd-install.url = "https://github.com/fluxcd/flux2/releases/download/v2.3.0/install.yaml"; # gh-release-update
helix.inputs.crane.follows = "crane";
helix.inputs.flake-utils.follows = "flake-utils";
helix.inputs.nixpkgs.follows = "nixpkgs";
helix.inputs.rust-overlay.follows = "rust-overlay";
helix.url = "github:AlexanderDickie/helix/copilot"; ## copilot support
hetzner-csi-driver.flake = false;
hetzner-csi-driver.url = "https://raw.githubusercontent.com/hetznercloud/csi-driver/v2.9.0/deploy/kubernetes/hcloud-csi.yml"; # gh-release-update
home-manager.inputs.nixpkgs.follows = "nixpkgs";
Expand Down
1 change: 0 additions & 1 deletion flake/packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,6 @@
];
zjstatus = inputs.zjstatus.packages.${system}.default;
zwift = inputs.zwift.packages.${system}.default;
helix-latest = inputs.helix.packages.${system}.helix;
persway = inputs.persway.packages.${system}.default;
wezterm = inputs.wezterm.packages.${system}.default;
unlockremote = pkgs.writeShellApplication {
Expand Down
34 changes: 5 additions & 29 deletions users/profiles/helix.nix
Original file line number Diff line number Diff line change
@@ -1,17 +1,7 @@
{
pkgs,
inputs,
...
}: let
copilot = pkgs.writeShellApplication {
name = "copilot";
text = ''
exec ${pkgs.nodejs}/bin/node ${inputs.copilot-vim}/dist/language-server.js "''$@"
'';
};
helix-copilot = pkgs.writeShellApplication {
{pkgs, ...}: let
helix-ai = pkgs.writeShellApplication {
name = "hx";
runtimeInputs = [copilot];
runtimeInputs = [pkgs.lsp-ai];
text = ''
if [ -e /run/agenix/groq-lsp-ai ]; then
GROQ_API_KEY="$(cat /run/agenix/groq-lsp-ai)"
Expand All @@ -21,19 +11,13 @@
ANTHROPIC_API_KEY="$(cat /run/agenix/anthropic-lsp-ai)"
export ANTHROPIC_API_KEY
fi
if [ -n "$GROQ_API_KEY" ] || [ -n "$ANTHROPIC_API_KEY" ]; then
exec ${pkgs.helix-latest}/bin/hx "''$@"
else
exec ${pkgs.helix-latest}/bin/hx -a "''$@"
fi
exec ${pkgs.helix}/bin/hx "''$@"
'';
};
in {
home.packages = [pkgs.lsp-ai];
programs.helix = {
enable = true;
package = helix-copilot;
package = helix-ai;
settings = {
theme = "catppuccin_frappe";

Expand Down Expand Up @@ -64,7 +48,6 @@ in {
auto-signature-help = false;
display-messages = true;
display-inlay-hints = true;
#copilot-auto = true;
};

statusline = {
Expand All @@ -81,9 +64,6 @@ in {
};

keys = {
insert = {
right = "copilot_apply_completion";
};
normal = {
space = {
t = ":open lsp-ai-chat.md";
Expand All @@ -96,10 +76,6 @@ in {
};
languages = {
language-server = {
#copilot = {
# command = "${copilot}/bin/copilot";
# args = ["--stdio"];
#};
lsp-ai = {
command = "lsp-ai";
config.memory.file_store = {};
Expand Down

0 comments on commit 5e1bf08

Please sign in to comment.