-
Notifications
You must be signed in to change notification settings - Fork 0
/
default.nix
98 lines (85 loc) · 2.27 KB
/
default.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
inputs: { lib, config, pkgs, ... }:
let
inherit (inputs) stylix neovim;
inherit (lib) mkIf mkEnableOption;
cfg = config.targets.danknil.neovim;
stylixColorscheme = with config.lib.stylix.colors; ''{
base00 = ${base00},
base01 = ${base01},
base02 = ${base02},
base03 = ${base03},
base04 = ${base04},
base05 = ${base05},
base06 = ${base06},
base07 = ${base07},
base08 = ${base08},
base09 = ${base09},
base0A = ${base0A},
base0B = ${base0B},
base0C = ${base0C},
base0D = ${base0D},
base0E = ${base0E},
base0F = ${base0F},
}'';
in
{
options.targets.danknil.neovim = {
enable = mkEnableOption "Custom danknil neovim config";
};
config = mkIf cfg.enable {
home.sessionVariables = {
EDITOR = "nvim";
};
# disable auto styling from stylix
stylix.targets.vim.enable = false;
programs.neovim = {
enable = true;
vimAlias = true;
vimdiffAlias = true;
withNodeJs = true;
# nightly neovim
package = neovim.packages.${pkgs.system}.default;
extraLuaConfig = ''
-- theming
_G.colorscheme = ${stylixColorscheme}
-- setting up vanilla settings
require 'autocmds'
require 'options'
-- installing lazy.nvim
require("lazy").setup({
spec = {
{ imports = "plugins" },
},
performance = {
reset_packpath = false,
rtp = {
reset = false,
}
},
dev = {
path = "${pkgs.vimUtils.packDir config.home-manager.users.USERNAME.programs.neovim.finalPackage.passthru.packpathDirs}/pack/myNeovimPackages/start",
patterns = { "folke" },
},
install = {
-- Safeguard in case we forget to install a plugin with Nix
missing = false,
},
})
-- setting up vanilla binds
require('mappings'):load_mappings('general', { noremap = true })
'';
};
xdg.configFile."nvim/lua" = {
recursive = true;
source = ./lua;
};
xdg.configFile."nvim/after" = {
recursive = true;
source = ./after;
};
xdg.configFile."nvim/query" = {
recursive = true;
source = ./query;
};
};
}