-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathflake.nix
121 lines (114 loc) · 3.42 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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
{
description = "nekowinston's neovim config";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-parts.url = "github:hercules-ci/flake-parts";
# neovim-nightly-overlay.url = "github:nix-community/neovim-nightly-overlay";
neovim-nix = {
url = "github:willruggiano/neovim.nix";
inputs.flake-parts.follows = "flake-parts";
inputs.nixpkgs.follows = "nixpkgs";
inputs.git-hooks.follows = "git-hooks";
inputs.example.follows = "";
};
nvim-treesitter-nix = {
url = "github:nekowinston/nvim-treesitter-nix";
inputs.nixpkgs.follows = "nixpkgs";
};
git-hooks.url = "github:cachix/git-hooks.nix";
};
outputs =
{ flake-parts, ... }@inputs:
flake-parts.lib.mkFlake { inherit inputs; } {
imports = [
./neovim.nix
inputs.git-hooks.flakeModule
inputs.neovim-nix.flakeModule
];
systems = [
"x86_64-linux"
"aarch64-linux"
"aarch64-darwin"
"x86_64-darwin"
];
perSystem =
{
self',
config,
pkgs,
system,
...
}:
{
_module.args.pkgs = import inputs.nixpkgs {
inherit system;
config.allowUnfree = true;
overlays = [
inputs.nvim-treesitter-nix.overlays.default
# inputs.neovim-nightly-overlay.overlays.default
(final: prev: {
java-debug = final.callPackage ./pkgs/java-debug { };
java-test = final.callPackage ./pkgs/java-test { };
})
];
};
pre-commit = {
settings = {
excludes = [ "_sources/.+" ];
hooks = {
nixfmt-rfc-style.enable = true;
stylua.enable = true;
};
};
};
devShells.default = pkgs.mkShell {
inherit (config.pre-commit.devShell) shellHook;
packages = with pkgs; [
self'.formatter
nix-tree
nvfetcher
];
};
formatter = pkgs.nixfmt-rfc-style;
packages =
let
neovim = config.neovim.final;
in
{
default = neovim;
neovim = neovim;
neovide = pkgs.callPackage ./pkgs/neovide {
env = {
NEOVIDE_FRAME = "none";
NEOVIDE_MULTIGRID = "1";
NEOVIM_BIN = "${neovim}/bin/nvim";
};
};
docker = pkgs.dockerTools.buildImage {
name = "nekowinston-nvim";
copyToRoot =
(with pkgs.dockerTools; [
usrBinEnv
binSh
caCertificates
fakeNss
])
++ [ neovim ];
};
inherit (pkgs) java-debug java-test;
};
};
};
nixConfig = {
extra-substituters = [
"https://attic.winston.sh/public"
"https://nix-community.cachix.org"
"https://pre-commit-hooks.cachix.org"
];
extra-trusted-public-keys = [
"public:gqpCDffg2eWolOCakuF0FhU0hmPHvOiBy2Z2rpyf8Mg="
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
"pre-commit-hooks.cachix.org-1:Pkk3Panw5AW24TOv6kz3PvLhlH8puAsJTBbOPmBo7Rc="
];
};
}