Skip to content

Commit be38ef1

Browse files
committed
feat(flake): add llm-agents input and overlay
Add llm-agents input in flake.nix and enable its overlay Attach llm-agents.overlays.default to mkPkgs and update flake.lock
1 parent cf2a01f commit be38ef1

6 files changed

Lines changed: 206 additions & 32 deletions

File tree

flake.lock

Lines changed: 158 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flake.nix

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,43 +4,55 @@
44
nixConfig = {
55
extra-substituters = [
66
"https://catppuccin.cachix.org"
7+
"https://cache.numtide.com"
78
];
89
extra-trusted-public-keys = [
910
"catppuccin.cachix.org-1:noG/4HkbhJb+lUAdKrph6LaozJvAeEEZj4N732IysmU="
11+
"niks3.numtide.com-1:DTx8wZduET09hRmMtKdQDxNNthLQETkc/yaX7M4qK0g="
1012
];
1113
};
1214

1315
inputs = {
1416
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
15-
flake-parts.url = "github:hercules-ci/flake-parts";
1617
catppuccin.url = "github:catppuccin/nix";
18+
flake-parts.url = "github:hercules-ci/flake-parts";
1719
systems.url = "github:nix-systems/default-linux";
1820

1921
home-manager = {
2022
url = "github:nix-community/home-manager";
2123
inputs.nixpkgs.follows = "nixpkgs";
2224
};
25+
llm-agents = {
26+
url = "github:numtide/llm-agents.nix";
27+
inputs.nixpkgs.follows = "nixpkgs";
28+
};
2329
};
2430

2531
outputs =
2632
inputs@{
33+
self,
2734
nixpkgs,
28-
flake-parts,
2935
home-manager,
30-
systems,
3136
catppuccin,
37+
flake-parts,
38+
llm-agents,
39+
systems,
3240
...
3341
}:
3442
let
3543
lib = nixpkgs.lib;
3644
username = "yayoi";
3745
homeDirectory = "/home/${username}";
46+
dotfiles = self.outPath;
3847
linuxSystems = import systems;
3948

4049
mkPkgs =
4150
system:
4251
import nixpkgs {
4352
inherit system;
53+
overlays = [
54+
llm-agents.overlays.default
55+
];
4456
config.allowUnfreePredicate =
4557
pkg:
4658
builtins.elem (lib.getName pkg) [
@@ -54,12 +66,12 @@
5466
pkgs = mkPkgs system;
5567

5668
modules = [
57-
./home.nix
69+
./nix/home.nix
5870
catppuccin.homeModules.catppuccin
5971
];
6072

6173
extraSpecialArgs = {
62-
inherit username homeDirectory;
74+
inherit username homeDirectory dotfiles;
6375
};
6476
};
6577
in

home.nix renamed to nix/home.nix

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
pkgs,
55
username,
66
homeDirectory,
7+
dotfiles,
78
...
89
}:
910

@@ -42,7 +43,6 @@ in
4243
ghq
4344
git
4445
git-wt
45-
# github-copilot-cli
4646
jq
4747
lazygit
4848
lua-language-server
@@ -111,7 +111,7 @@ in
111111
}
112112
{
113113
name = "powerlevel10k-config";
114-
src = lib.cleanSource ./zsh;
114+
src = lib.cleanSource "${dotfiles}/zsh";
115115
file = "p10k.zsh";
116116
}
117117
{

nvim/after/lsp/nil_ls.lua

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,9 @@ local format_config = lsp_utils.format_config
33

44
---@type vim.lsp.Config
55
return {
6+
before_init = function(params, _)
7+
local text_document = params.capabilities and params.capabilities.textDocument
8+
if text_document then text_document.semanticTokens = nil end
9+
end,
610
on_attach = format_config(false),
711
}

nvim/lua/core/lsp-utils.lua

Lines changed: 24 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,7 @@ local o = {}
33
---@param client string | table
44
local function _convert_client(client)
55
local _client = client
6-
if type(client) == "string" then
7-
_client = require("lspconfig")[client]
8-
end
6+
if type(client) == "string" then _client = require("lspconfig")[client] end
97

108
assert(_client)
119

@@ -72,12 +70,13 @@ o.ft.css_like = {
7270
"less",
7371
}
7472

75-
o.ft.html_like = vim.iter({
76-
o.ft.markdown_like,
77-
o.ft.css_like,
78-
o.ft.js_framework_like,
79-
{ "html", "htmldjango" },
80-
})
73+
o.ft.html_like = vim
74+
.iter({
75+
o.ft.markdown_like,
76+
o.ft.css_like,
77+
o.ft.js_framework_like,
78+
{ "html", "htmldjango" },
79+
})
8180
:flatten(math.huge)
8281
:totable()
8382

@@ -93,11 +92,12 @@ o.ft.yaml_like = {
9392
"yaml.gitlab",
9493
}
9594

96-
o.ft.config_like = vim.iter({
97-
o.ft.json_like,
98-
o.ft.yaml_like,
99-
{ "toml" },
100-
})
95+
o.ft.config_like = vim
96+
.iter({
97+
o.ft.json_like,
98+
o.ft.yaml_like,
99+
{ "toml" },
100+
})
101101
:flatten(math.huge)
102102
:totable()
103103

@@ -124,10 +124,11 @@ o.ft.node_specific_files = {
124124
"pnpm-lock.yaml", -- pnpm
125125
}
126126

127-
o.ft.node_files = vim.iter({
128-
o.ft.node_specific_files,
129-
"package.json",
130-
})
127+
o.ft.node_files = vim
128+
.iter({
129+
o.ft.node_specific_files,
130+
"package.json",
131+
})
131132
:flatten(math.huge)
132133
:totable()
133134

@@ -173,10 +174,11 @@ function o.setup(client, extra_opts)
173174
---@class LSPConfigOpts
174175
local local_opts = vim.tbl_deep_extend("force", {}, default_opts, extra_opts or {})
175176

176-
local_opts.filetypes = vim.iter({
177-
local_opts.filetypes or o.get_default_filetypes(client),
178-
local_opts.extra_filetypes or {},
179-
})
177+
local_opts.filetypes = vim
178+
.iter({
179+
local_opts.filetypes or o.get_default_filetypes(client),
180+
local_opts.extra_filetypes or {},
181+
})
180182
:flatten()
181183
:totable()
182184

0 commit comments

Comments
 (0)