blob: 37552018ce04b151ffc2da8829b541ed74ed657f (
plain) (
blame)
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
|
{
config,
lib,
pkgs,
...
}:
with lib; let
cfg = config.nixfiles.modules.vim;
in {
options.nixfiles.modules.vim = {
enable = mkEnableOption "Vim";
rc = mkOption {
type = types.str;
default = readFile ./rc.vim;
description = "Configuration file.";
};
plugins = mkOption {
type = with types; listOf package;
default = with pkgs.vimPlugins; [
editorconfig-vim
vim-eunuch
vim-nix
vim-sensible
vim-sleuth
vim-surround
vim-unimpaired
];
description = "Plugins.";
};
};
config = mkIf cfg.enable {
environment = with config.programs.vim; {
systemPackages = [package];
variables = rec {
EDITOR = mkOverride 100 "${package}/bin/vim";
VISUAL = EDITOR;
};
};
};
}
|