-
-
Notifications
You must be signed in to change notification settings - Fork 3
/
flake.nix
90 lines (80 loc) · 2.81 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
{
description = "Vim front-end for the email client Himalaya CLI";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
utils.url = "github:numtide/flake-utils";
flake-compat = {
url = "github:edolstra/flake-compat";
flake = false;
};
};
outputs = { self, nixpkgs, utils, ... }:
utils.lib.eachDefaultSystem
(system:
let
pkgs = import nixpkgs { inherit system; };
plugin = name:
builtins.trace "${name} rev: ${pkgs.vimPlugins.${name}.src.rev}" pkgs.vimPlugins.${name};
plugins = map plugin;
customRC = ''
syntax on
filetype plugin on
packadd! himalaya
" native, fzf or telescope
let g:himalaya_executable = '/nix/store/w21m119i0ild3wlb4i72s9xdqdcrj4hz-user-environment/bin/himalaya'
let g:himalaya_config_path = '/home/soywod/.himalaya.config.toml'
let g:himalaya_folder_picker = 'telescope'
let g:himalaya_folder_picker_telescope_preview = v:false
let g:himalaya_complete_contact_cmd = 'echo test@localhost'
'';
in
rec {
# nix build
packages.default = pkgs.vimUtils.buildVimPluginFrom2Nix {
name = "himalaya";
namePrefix = "";
src = self;
# buildInputs = with pkgs; [ himalaya ];
# postPatch = with pkgs; ''
# substituteInPlace plugin/himalaya.vim \
# --replace "default_executable = 'himalaya'" "default_executable = '${himalaya}/bin/himalaya'"
# '';
};
# nix develop
devShell = pkgs.mkShell {
buildInputs = self.packages.${system}.default.buildInputs;
nativeBuildInputs = with pkgs; [
# Nix LSP + formatter
rnix-lsp
nixpkgs-fmt
# Vim LSP
nodejs
nodePackages.vim-language-server
# Lua LSP
lua52Packages.lua-lsp
# FZF
fzf
# Editors
((vim_configurable.override { }).customize {
name = "vim";
vimrcConfig = {
inherit customRC;
packages.myplugins = {
start = with pkgs.vimPlugins; [ fzf-vim ];
opt = [ self.packages.${system}.default ];
};
};
})
(neovim.override {
configure = {
inherit customRC;
packages.myPlugins = {
start = plugins [ "telescope-nvim" "fzf-vim" ];
opt = [ self.packages.${system}.default ];
};
};
})
];
};
});
}