-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathflake.nix
More file actions
121 lines (116 loc) · 3.67 KB
/
Copy pathflake.nix
File metadata and controls
121 lines (116 loc) · 3.67 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
{
description = "neonvoid's Neovim configuration (nvf)";
nixConfig = {
substituters = [
"https://cache.nixos.org"
"https://nix-community.cachix.org"
"https://cache.garnix.io"
];
trusted-substituters = [
"https://cache.nixos.org"
"https://cache.garnix.io"
"https://nix-community.cachix.org"
];
};
inputs = {
nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable";
nvf.url = "github:notashelf/nvf";
flake-parts.url = "github:hercules-ci/flake-parts";
# Plugins not packaged in nixpkgs
eldritch-nvim = {
url = "github:eldritch-theme/eldritch.nvim";
flake = false;
};
resolved-nvim = {
url = "github:noamsto/resolved.nvim";
flake = false;
};
presenting-nvim = {
url = "github:sotte/presenting.nvim";
flake = false;
};
milli-nvim = {
url = "github:Amansingh-afk/milli.nvim";
flake = false;
};
};
outputs =
{
nvf,
flake-parts,
nixpkgs,
...
}@inputs:
flake-parts.lib.mkFlake { inherit inputs; } {
systems = [
"x86_64-linux"
"aarch64-linux"
"x86_64-darwin"
"aarch64-darwin"
];
perSystem =
{ system, ... }:
let
pkgs = import nixpkgs {
inherit system;
config = {
allowUnfree = true;
# https://github.com/NixOS/nixpkgs/issues/535580
permittedInsecurePackages = [
"pnpm-10.34.0"
];
};
overlays = [
# hmts-nvim uses the old treesitter predicate API where match[id] was a single
# TSNode; nvim 0.11+ changed it to always be a list. Unwrap the first element.
(final: prev: {
vimPlugins = prev.vimPlugins // {
hmts-nvim = prev.vimPlugins.hmts-nvim.overrideAttrs (old: {
postPatch = (old.postPatch or "") + ''
substituteInPlace plugin/hmts.lua \
--replace-fail \
'local node = match[predicate[2]]:parent()' \
'local _n = match[predicate[2]]; local node = (type(_n) == "table" and _n[1] or _n):parent()' \
--replace-fail \
'local path_node = match[predicate[2]]' \
'local _pn = match[predicate[2]]; local path_node = type(_pn) == "table" and _pn[1] or _pn'
'';
});
};
})
];
};
userPlugins = {
eldritch-nvim = pkgs.vimUtils.buildVimPlugin {
name = "eldritch.nvim";
src = inputs.eldritch-nvim;
};
resolved-nvim = pkgs.vimUtils.buildVimPlugin {
name = "resolved.nvim";
src = inputs.resolved-nvim;
};
markdown-toc-nvim = pkgs.vimUtils.buildVimPlugin {
name = "markdown-toc.nvim";
src = inputs.markdown-toc-nvim;
};
presenting-nvim = pkgs.vimUtils.buildVimPlugin {
name = "presenting.nvim";
src = inputs.presenting-nvim;
};
milli-nvim = pkgs.vimUtils.buildVimPlugin {
name = "milli.nvim";
src = inputs.milli-nvim;
};
};
neovimConfig = nvf.lib.neovimConfiguration {
inherit pkgs;
modules = [ ./config ];
extraSpecialArgs = { inherit userPlugins; };
};
in
{
# Run `nix run .` to start neovim
packages.default = neovimConfig.neovim;
};
};
}