generated from nix-community/kickstart-nix.nvim
-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
116 lines (104 loc) · 2.98 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
{
description = "Neovim derivation";
nixConfig = {
extra-substituters = [
# The neovim nightly build is cached by the nix community.
"https://nix-community.cachix.org"
];
extra-trusted-public-keys = [
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
];
};
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
gen-luarc.url = "github:mrcjkb/nix-gen-luarc-json";
neovim-nightly-overlay.url = "github:nix-community/neovim-nightly-overlay";
# Add bleeding-edge plugins here.
# They can be updated with `nix flake update` (make sure to commit the
# generated flake.lock).
everforest-nvim = {
url = "github:neanias/everforest-nvim";
flake = false;
};
vim-characterize = {
url = "github:tpope/vim-characterize";
flake = false;
};
};
outputs = inputs @ {
self,
nixpkgs,
flake-utils,
gen-luarc,
neovim-nightly-overlay,
...
}: let
supportedSystems = [
"x86_64-linux"
"aarch64-linux"
"x86_64-darwin"
"aarch64-darwin"
];
in
flake-utils.lib.eachSystem supportedSystems (system: let
pkgs = import nixpkgs {
inherit system;
overlays = [
# Add the neovim nightly package to the list of packages.
(final: prev: {
neovim-nightly-unwrapped = neovim-nightly-overlay.packages.${system}.default;
})
# This adds a function can be used to generate a .luarc.json
# containing the Neovim API all plugins in the workspace directory.
# The generated file can be symlinked in the devShell's shellHook.
gen-luarc.overlays.default
];
};
shell = pkgs.mkShell {
name = "nvim-devShell";
buildInputs = with pkgs; [
# Tools for Lua and Nix development, useful for editing files in this repo.
lua-language-server
nixd
stylua
luajitPackages.luacheck
];
shellHook = ''
ln -fs ${pkgs.nvim-luarc-json} .luarc.json
'';
};
neovim-overlay = import ./nix/neovim-overlay.nix {
inherit pkgs;
inherit inputs;
};
neovim-module = import ./nix/module.nix {
inherit pkgs;
inherit inputs;
};
neovim-package = import ./nix/package.nix {
inherit pkgs;
lib = pkgs;
inherit inputs;
};
in {
packages = rec {
nvim = neovim-package.nvim-nix;
default = nvim;
};
devShells = {
default = shell;
};
# You can add this overlay to your NixOS configuration.
overlays = rec {
nvim = neovim-overlay;
default = nvim;
};
# Or you can add this module in your home manager module, allowing you
# to manually set the configuration.
hmModules = rec {
nvim = neovim-module;
default = nvim;
};
});
}