-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathflake.nix
119 lines (116 loc) · 3.3 KB
/
flake.nix
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
{
description = "Ruixi-rebirth's NixVim configuration";
inputs = {
flake-parts.url = "github:hercules-ci/flake-parts";
treefmt-nix.url = "github:numtide/treefmt-nix";
flake-root.url = "github:srid/flake-root";
nixpkgs.url = "github:NixOS/nixpkgs";
nixvim = {
url = "github:nix-community/nixvim";
inputs.nixpkgs.follows = "nixpkgs";
};
neovim-nightly-overlay.url = "github:nix-community/neovim-nightly-overlay";
nixd.url = "github:nix-community/nixd";
pre-commit-hooks.url = "github:cachix/pre-commit-hooks.nix";
#plugins list
avante-nvim = {
url = "github:yetone/avante.nvim";
flake = false;
};
minuet-ai-nvim = {
url = "github:milanglacier/minuet-ai.nvim";
flake = false;
};
blink-cmp.url = "github:saghen/blink.cmp";
vim-translator = {
url = "github:voldikss/vim-translator";
flake = false;
};
};
outputs =
inputs@{ self, ... }:
let
lazy-nvim-config = import ./config/lazy.nix;
in
inputs.flake-parts.lib.mkFlake { inherit inputs; } {
imports = [
inputs.flake-root.flakeModule
inputs.treefmt-nix.flakeModule
./pre-commit-hooks.nix
];
debug = true;
systems = [
"x86_64-linux"
"x86_64-darwin"
];
perSystem =
{
pkgs,
system,
config,
...
}:
let
nixvimLib = inputs.nixvim.lib.${system};
nixvim' = inputs.nixvim.legacyPackages.${system};
lazynvim = nixvim'.makeNixvimWithModule {
inherit pkgs;
module = lazy-nvim-config;
extraSpecialArgs = {
inherit inputs;
};
};
in
{
treefmt.config = {
inherit (config.flake-root) projectRootFile;
flakeCheck = true;
settings = {
global.excludes = [
# "*.yml"
];
};
package = pkgs.treefmt;
programs.prettier.enable = true;
programs.stylua = {
enable = true;
settings = {
indent_type = "Spaces";
indent_width = 2;
};
};
programs.nixfmt-rfc-style.enable = true;
};
_module.args.pkgs = import inputs.nixpkgs {
inherit system;
overlays = [
inputs.neovim-nightly-overlay.overlays.default
# (final: prev: {
# neovim-unwrapped =
# inputs.neovim-nightly-overlay.packages.${final.stdenv.hostPlatform.system}.default;
# })
inputs.nixd.overlays.default
];
};
checks = {
# Run `nix flake check .` to verify config is not broken
default = nixvimLib.check.mkTestDerivationFromNvim {
name = "";
nvim = lazynvim;
};
};
packages = {
default = lazynvim;
lazynvim = lazynvim;
};
formatter = config.treefmt.build.wrapper;
devShells = {
default = pkgs.mkShell {
shellHook = ''
${config.pre-commit.installationScript}
'';
};
};
};
};
}