update nixvim, fix copilot cmp

This commit is contained in:
EdenQwQ 2025-10-11 11:16:35 +08:00
parent 9eba52ac62
commit 0bc11dd3d4
4 changed files with 57 additions and 53 deletions

45
flake.lock generated
View file

@ -164,11 +164,11 @@
"quickshell": "quickshell_2"
},
"locked": {
"lastModified": 1759633142,
"narHash": "sha256-iRN4xtctVGELGkuhFPZLJYSAk0O/f7xLTQussuaaoDo=",
"lastModified": 1759884507,
"narHash": "sha256-YhsD1d0Xk2LXp4Hgx7xI5nRS9REMKb+QGpejFM3fcdU=",
"owner": "AvengeMedia",
"repo": "DankMaterialShell",
"rev": "804bf879edc17c20e3b2810b74c7f8187c2ec538",
"rev": "8cd0d5faa5f546472d3be5e843d58402ae3215a6",
"type": "github"
},
"original": {
@ -1078,6 +1078,22 @@
}
},
"nixpkgs_13": {
"locked": {
"lastModified": 1759977445,
"narHash": "sha256-LYr4IDfuihCkFAkSYz5//gT2r1ewcWBYgd5AxPzPLIo=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "2dad7af78a183b6c486702c18af8a9544f298377",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixpkgs-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_14": {
"locked": {
"lastModified": 1759381078,
"narHash": "sha256-gTrEEp5gEspIcCOx9PD8kMaF1iEmfBcTbO0Jag2QhQs=",
@ -1093,7 +1109,7 @@
"type": "github"
}
},
"nixpkgs_14": {
"nixpkgs_15": {
"locked": {
"lastModified": 1754340878,
"narHash": "sha256-lgmUyVQL9tSnvvIvBp7x1euhkkCho7n3TMzgjdvgPoU=",
@ -1127,11 +1143,11 @@
},
"nixpkgs_3": {
"locked": {
"lastModified": 1759632233,
"narHash": "sha256-krgZxGAIIIKFJS+UB0l8do3sYUDWJc75M72tepmVMzE=",
"lastModified": 1757034884,
"narHash": "sha256-PgLSZDBEWUHpfTRfFyklmiiLBE1i1aGCtz4eRA3POao=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "d7f52a7a640bc54c7bb414cca603835bf8dd4b10",
"rev": "ca77296380960cd497a765102eeb1356eb80fed0",
"type": "github"
},
"original": {
@ -1234,23 +1250,20 @@
"nixvim": {
"inputs": {
"flake-parts": "flake-parts_5",
"nixpkgs": [
"nixpkgs-stable"
],
"nixpkgs": "nixpkgs_13",
"nuschtosSearch": "nuschtosSearch",
"systems": "systems_6"
},
"locked": {
"lastModified": 1758373036,
"narHash": "sha256-tm73KNHsGQwAAoFEcAvuXAmHf3KaWLSuf/R9UQ6WMnU=",
"lastModified": 1760105514,
"narHash": "sha256-un7IqbXz3hC8rHGAgD/mVbDdzTxf9ar3UjGnRxuYoYA=",
"owner": "nix-community",
"repo": "nixvim",
"rev": "a30decbd5fc231e84dfefeb75bc7f57d8167726c",
"rev": "bb9d744b644d160336b7ff681dac1b19db01ba2c",
"type": "github"
},
"original": {
"owner": "nix-community",
"ref": "nixos-25.05",
"repo": "nixvim",
"type": "github"
}
@ -1258,7 +1271,7 @@
"nur": {
"inputs": {
"flake-parts": "flake-parts_6",
"nixpkgs": "nixpkgs_13"
"nixpkgs": "nixpkgs_14"
},
"locked": {
"lastModified": 1759643458,
@ -1675,7 +1688,7 @@
},
"treefmt-nix_2": {
"inputs": {
"nixpkgs": "nixpkgs_14"
"nixpkgs": "nixpkgs_15"
},
"locked": {
"lastModified": 1758728421,

View file

@ -67,10 +67,7 @@
url = "github:nix-community/stylix";
inputs.nixpkgs.follows = "nixpkgs";
};
nixvim = {
url = "github:nix-community/nixvim/nixos-25.05";
inputs.nixpkgs.follows = "nixpkgs-stable";
};
nixvim.url = "github:nix-community/nixvim";
nil = {
url = "github:oxalica/nil";
inputs.nixpkgs.follows = "nixpkgs";

View file

@ -36,6 +36,19 @@ in
# },
# })
# '';
extraConfigLua =
# lua
''
local cmp = require("cmp")
local current_sources = cmp.get_config().sources or {}
table.insert(current_sources, {
name = "copilot",
priority = 100,
})
cmp.setup({
sources = current_sources,
})
'';
plugins = {
copilot-lua = {
enable = true;
@ -46,17 +59,17 @@ in
};
};
copilot-cmp.enable = true;
cmp.settings.sources = [
{
# name = "fittencode";
name = "copilot";
group_index = 1;
}
];
# cmp.settings.sources = [
# {
# # name = "fittencode";
# name = "copilot";
# group_index = 2;
# }
# ];
codecompanion = {
enable = true;
settings = {
adapters.deepseek.__raw =
adapters.http.deepseek.__raw =
# lua
''
function()
@ -71,7 +84,7 @@ in
})
end
'';
adapters.siliconflow.__raw =
adapters.http.siliconflow.__raw =
# lua
''
function ()
@ -92,28 +105,7 @@ in
})
end
'';
adapters.zjuchat.__raw =
# lua
''
function ()
local zjuchat_token_file = io.open(os.getenv("XDG_RUNTIME_DIR") .. "/" .. "${get_base_secret config.age.secrets.zjuchat_token.path}", "r")
local zjuchat_api_key = zjuchat_token_file:read()
zjuchat_token_file:close()
return require("codecompanion.adapters").extend("openai_compatible", {
name = "zjuchat",
env = {
url = "https://chat.zju.edu.cn/api/ai",
api_key = zjuchat_api_key,
},
schema = {
model = {
default = "deepseek-v3-671b",
}
}
})
end
'';
adapters.gemini.__raw =
adapters.http.gemini.__raw =
# lua
''
function()

View file

@ -127,8 +127,10 @@
};
lspsaga = {
enable = true;
lightbulb.virtualText = true;
lightbulb.sign = false;
settings.lightbulb = {
virtualText = true;
sign = false;
};
};
trouble.enable = true;
lsp-signature.enable = true;