-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflake.nix
129 lines (116 loc) · 3.34 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
120
121
122
123
124
125
126
127
128
129
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-parts = {
url = "github:hercules-ci/flake-parts";
inputs.nixpkgs-lib.follows = "nixpkgs";
};
treefmt-nix = {
url = "github:numtide/treefmt-nix";
inputs.nixpkgs.follows = "nixpkgs";
};
nvf.url = "github:notashelf/nvf";
};
outputs = inputs @ {
self,
flake-parts,
nixpkgs,
treefmt-nix,
...
}:
flake-parts.lib.mkFlake {inherit inputs;} {
imports = [
inputs.treefmt-nix.flakeModule
];
systems = [
"x86_64-linux"
"aarch64-linux"
"aarch64-darwin"
"x86_64-darwin"
];
perSystem = {
config,
self',
inputs',
pkgs,
system,
...
}: let
neovimConfigured = inputs.nvf.lib.neovimConfiguration {
inherit (nixpkgs.legacyPackages.${system}) pkgs;
modules = [
{
config.vim = {
# Enable custom theming options
theme.enable = true;
languages = {
enableLSP = true;
enableTreesitter = true;
bash.enable = true;
html.enable = true;
markdown.enable = true;
nix.enable = true;
# nu.enable = true;
rust.enable = true;
sql.enable = true;
tailwind.enable = true;
ts.enable = true;
};
# lazy.plugins = {
# direnv.nvim = {
# # ^^^^^^^^^ this name should match the package.pname or package.name
# package = direnv-nvim;
# setupModule = "direnv";
# setupOpts = {option_name = false;};
# after = "print('direnv loaded')";
# };
# };
autocomplete.nvim-cmp.enable = true;
statusline.lualine.enable = true;
telescope.enable = true;
};
}
];
};
in {
# checks = {
# # Run `nix flake check .` to verify that your config is not broken
# default = nvfLib.check.mkTestDerivationFromNixvimModule nixvimModule;
# };
packages = {
# Lets you run `nix run .` to start nixvim
default = neovimConfigured.neovim;
};
# Add your auto-formatters here.
# cf. https://numtide.github.io/treefmt/
treefmt.config = {
projectRootFile = "flake.nix";
programs = {
alejandra.enable = true;
just.enable = true;
# jsonfmt.enable = true;
mdformat.enable = true;
# prettier.enable = true;
# rustfmt.enable = true;
shfmt.enable = true;
# stylua.enable = true;
# yamlfmt.enable = true;
};
};
devShells.default = pkgs.mkShell {
inputsFrom = [
config.treefmt.build.devShell
];
nativeBuildInputs = with pkgs; [
alejandra
just
statix
nix-tree
# so the shell doesn't get messed up
bashInteractive
bash-completion
];
};
};
};
}