-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflake.nix
99 lines (96 loc) · 3.12 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
{
description = "A nixvim configuration";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
nixvim.url = "github:jonboh/nixvim";
# nixvim.url = "/home/jonboh/devel/nixvim";
# nixvim.url = "github:nix-community/nixvim";
flake-utils.url = "github:numtide/flake-utils";
nixneovimplugins.url = "github:NixNeovim/NixNeovimPlugins";
neovim-nightly-overlay.url = "github:nix-community/neovim-nightly-overlay";
};
outputs = {
self,
nixpkgs,
nixvim,
flake-utils,
nixneovimplugins,
...
} @ inputs:
flake-utils.lib.eachDefaultSystem (system: let
nixvimLib = nixvim.lib.${system};
pkgs-nightly = import nixpkgs {
inherit system;
overlays = [
nixneovimplugins.overlays.default
inputs.neovim-nightly-overlay.overlays.default
];
};
pkgs = import nixpkgs {
inherit system;
overlays = [
nixneovimplugins.overlays.default
];
};
nixvim' = nixvim.legacyPackages.${system};
nvim-nightly = nixvim'.makeNixvimWithModule {
pkgs = pkgs-nightly;
extraSpecialArgs = {inherit self;};
module = import ./config {full = true;};
};
nvim = nixvim'.makeNixvimWithModule {
inherit pkgs;
extraSpecialArgs = {inherit self;};
module = import ./config {full = true;};
};
nvim-light = nixvim'.makeNixvimWithModule {
inherit pkgs;
extraSpecialArgs = {inherit self;};
module = import ./config {full = false;};
};
nixvim-nightly-config = with nixpkgs.legacyPackages.${system};
stdenv.mkDerivation {
name = "nixvim-nightly-config";
buildInputs = [nvim-nightly];
buildCommand = ''
mkdir -p $out/bin
ln -s ${nvim-nightly}/bin/nvim $out/bin/nixvim
ln -s ${nvim-nightly}/bin/nixvim-print-init $out/bin/nixvim-print-init
'';
};
nixvim-config = with nixpkgs.legacyPackages.${system};
stdenv.mkDerivation {
name = "nixvim-config";
buildInputs = [nvim];
buildCommand = ''
mkdir -p $out/bin
ln -s ${nvim}/bin/nvim $out/bin/nixvim
ln -s ${nvim}/bin/nixvim-print-init $out/bin/nixvim-print-init
'';
};
nixvim-light-config = with nixpkgs.legacyPackages.${system};
stdenv.mkDerivation {
name = "nixvim-light-config";
buildInputs = [nvim-light];
buildCommand = ''
mkdir -p $out/bin
ln -s ${nvim-light}/bin/nvim $out/bin/nixvim-light
ln -s ${nvim-light}/bin/nixvim-print-init $out/bin/nixvim-print-init
'';
};
in {
checks = {
# Run `nix flake check .` to verify that your config is not broken
default = nixvimLib.check.mkTestDerivationFromNvim {
inherit nvim;
name = "A nixvim configuration";
};
};
packages = {
default = nixvim-nightly-config;
inherit nixvim-nightly-config;
inherit nixvim-config;
nixvim-light-config = nixvim-light-config;
};
});
}