-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathflake.nix
More file actions
104 lines (98 loc) · 3 KB
/
flake.nix
File metadata and controls
104 lines (98 loc) · 3 KB
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
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
flake-parts.url = "github:hercules-ci/flake-parts";
treefmt-nix.url = "github:numtide/treefmt-nix";
neovim-nightly-overlay = {
url = "github:nix-community/neovim-nightly-overlay";
};
plugins-alduin = {
url = "github:conorhk/alduin.nvim";
flake = false;
};
plugins-99 = {
url = "github:ThePrimeagen/99";
flake = false;
};
};
outputs =
inputs@{ flake-parts, ... }:
flake-parts.lib.mkFlake { inherit inputs; } {
imports = [ inputs.treefmt-nix.flakeModule ];
systems = [
"x86_64-linux"
"aarch64-linux"
"x86_64-darwin"
"aarch64-darwin"
];
perSystem =
{
self',
pkgs,
system,
...
}:
let
commonArgs = {
neovimPlugins = {
alduin = pkgs.vimUtils.buildVimPlugin {
name = "alduin";
src = inputs.plugins-alduin;
};
};
vscode-java-debug = pkgs.vscode-extensions.vscjava.vscode-java-debug;
vscode-java-test = pkgs.vscode-extensions.vscjava.vscode-java-test;
};
ninetyninePlugin = {
ninetynine = pkgs.vimUtils.buildVimPlugin {
name = "99.nvim";
src = inputs.plugins-99;
nvimRequireCheck = "99";
};
};
in
{
packages = {
default = pkgs.callPackage ./default.nix commonArgs;
nightly = pkgs.callPackage ./default.nix (
commonArgs
// {
neovim-unwrapped = inputs.neovim-nightly-overlay.packages.${system}.neovim;
}
);
work = pkgs.callPackage ./default.nix (
commonArgs
// {
neovim-unwrapped = inputs.neovim-nightly-overlay.packages.${system}.neovim;
neovimPlugins = commonArgs.neovimPlugins // ninetyninePlugin;
}
);
};
devShells.default = pkgs.mkShell {
packages = [
pkgs.pre-commit
(pkgs.writeShellScriptBin "nvim-dev" ''
export NVIM_APPNAME=nvim-dev
exec ${self'.packages.default}/bin/nvim \
-u "$PWD/init.lua" \
--cmd "set runtimepath^=$PWD" \
"$@"
'')
];
shellHook = ''
echo "Development shell loaded!"
echo "Use 'nvim-dev' to run neovim with live config from current directory"
echo "Uses the same neovim build as the package but with hot-reloadable config"
pre-commit install --install-hooks
'';
};
treefmt.config = {
projectRootFile = "flake.nix";
programs = {
nixfmt.enable = true;
stylua.enable = true;
};
};
};
};
}