-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathflake.nix
More file actions
121 lines (116 loc) · 3.62 KB
/
Copy pathflake.nix
File metadata and controls
121 lines (116 loc) · 3.62 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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
{
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: let
supportedSystems = ["x86_64-linux"];
in
flake-utils.lib.eachSystem supportedSystems (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 = rec {
default = nixvim-config;
inherit nixvim-nightly-config;
inherit nixvim-config;
inherit nixvim-light-config;
};
apps = rec {
default = nixvim;
nixvim = {
type = "app";
program = "${nixvim-config}/bin/nixvim";
};
nixvim-nightly = {
type = "app";
program = "${nixvim-nightly-config}/bin/nixvim";
};
nixvim-light = {
type = "app";
program = "${nixvim-light-config}/bin/nixvim-light";
};
};
hydraJobs = {
inherit (self) packages;
};
});
}