-
-
Notifications
You must be signed in to change notification settings - Fork 12
/
flake.nix
104 lines (101 loc) · 2.67 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
{
description = "care.nvim package + dev environment";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
flake-parts.url = "github:hercules-ci/flake-parts";
gen-luarc.url = "github:mrcjkb/nix-gen-luarc-json";
};
outputs = inputs @ {
self,
nixpkgs,
flake-parts,
gen-luarc,
...
}:
flake-parts.lib.mkFlake {inherit inputs;} {
systems = [
"x86_64-linux"
"x86_64-darwin"
"aarch64-darwin"
];
perSystem = {system, ...}: let
pkgs = import nixpkgs {
inherit system;
overlays = [
gen-luarc.overlays.default
self.overlays.default
];
};
luarc = pkgs.mk-luarc {
nvim = pkgs.neovim-unwrapped;
};
in {
devShells.default = pkgs.mkShell {
name = "lua devShell";
shellHook = ''
ln -fs ${pkgs.luarc-to-json luarc} .luarc.json
'';
buildInputs = with pkgs; [
lua-language-server
stylua
alejandra
(lua5_1.withPackages (ps:
with ps; [
luarocks
busted
luacheck
fzy
nlua
]))
];
};
packages = rec {
default = care-nvim;
inherit (pkgs.vimPlugins) care-nvim;
nvim = let
config = pkgs.neovimUtils.makeNeovimConfig {
plugins = with pkgs; [
care-nvim
fzy
];
};
in
pkgs.wrapNeovimUnstable pkgs.neovim-unwrapped config;
};
};
flake = {
overlays.default = final: prev: let
luaPackage-override = luaself: luaprev: {
care-nvim = luaself.callPackage ({
buildLuarocksPackage,
lua,
fzy,
}:
buildLuarocksPackage {
pname = "care.nvim";
version = "scm-1";
knownRockspec = "${self}/care.nvim-scm-1.rockspec";
propagatedBuildInputs = [
lua
fzy
];
}) {};
};
in {
lua5_1 = prev.lua5_1.override {
packageOverrides = luaPackage-override;
};
lua51Packages = prev.lua51Packages // final.lua5_1.pkgs;
vimPlugins =
prev.vimPlugins
// {
care-nvim = final.neovimUtils.buildNeovimPlugin {
pname = "care.nvim";
version = "dev";
src = self;
};
};
};
};
};
}