-
Notifications
You must be signed in to change notification settings - Fork 1
/
flake.nix
136 lines (125 loc) · 3.85 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
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
{
description = "My neovim configuration, packaging managed by nix.";
inputs = {
# nixpkgs.url = github:NixOS/nixpkgs?rev=e12211201092f08c24d710c1697cca16afae3a4c;
nixpkgs.url = github:NixOS/nixpkgs?ref=nixos-unstable;
nixpkgs-pinned.url = github:NixOS/nixpkgs?rev=5e871d8aa6f57cc8e0dc087d1c5013f6e212b4ce;
# neorg-overlay.url = github:nvim-neorg/nixpkgs-neorg-overlay;
banner = {
url = "github:the-argus/banner.nix";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = {
self,
nixpkgs,
nixpkgs-pinned,
# neorg-overlay,
banner,
...
}: let
supportedSystems = [
"x86_64-linux"
"aarch64-linux"
];
genSystems = nixpkgs.lib.genAttrs supportedSystems;
mkPkgs = system: nixpkgSet:
import nixpkgSet {
overlays = [
# neorg-overlay.overlays.default
(import ./overlays.nix)
(_: _: {qmlls = self.packages.${system}.qmlls;})
];
inherit system;
};
# unstable and pkgs are the same thing as of now.
unstable = genSystems (system: mkPkgs system nixpkgs);
pinned = genSystems (system: mkPkgs system nixpkgs-pinned);
pkgs = unstable;
in {
packages = genSystems (system: let
# function to get plugins based on inputs
getPlugins = args:
pkgs.${system}.callPackage ./plugins.nix ({
unstable = unstable.${system};
inherit banner;
}
// args);
# turns init.lua into a /nix/store file, plus some settings
luaFile = args: pkgs.${system}.callPackage ./lua.nix args;
wrapNeovim = args: pkgs.${system}.callPackage ./wrapper.nix args;
# function that combines luaFile, getPlugins, and the wrappers
defaultWrapperArgs = {
minimal,
UsingDvorak,
}: {lua = luaFile {inherit minimal UsingDvorak;};};
defaultPluginsArgs = {bannerPalette = ./default-palette.yaml;};
mkNeovim = {
pluginsArgs ? defaultPluginsArgs,
minimal ? false,
UsingDvorak ? false,
wrapperArgs ? defaultWrapperArgs {inherit minimal UsingDvorak;},
useQmlls ? false,
...
}: let
defaultWrapperArgsEvaluated = defaultWrapperArgs {inherit minimal UsingDvorak;};
in (
wrapNeovim ({
inherit minimal useQmlls;
plugins = getPlugins (pluginsArgs // {inherit minimal;});
}
// defaultWrapperArgsEvaluated
// wrapperArgs)
);
in {
inherit mkNeovim;
default = mkNeovim {
useQmlls = true;
};
minimal = mkNeovim {minimal = true;};
qmlls = pinned.${system}.callPackage ./packages/qmlls {};
rosepine = mkNeovim {
wrapperArgs = {
viAlias = true;
vimAlias = true;
};
pluginsArgs = {
bannerPalette = {
base00 = "191724";
base01 = "1f1d2e";
base02 = "26233a";
base03 = "555169";
base04 = "6e6a86";
base05 = "e0def4";
base06 = "f0f0f3";
base07 = "c5c3ce";
base08 = "e2e1e7";
base09 = "eb6f92";
base0A = "f6c177";
base0B = "ebbcba";
base0C = "31748f";
base0D = "9ccfd8";
base0E = "c4a7e7";
base0F = "e5e5e5";
confirm = "31748f";
warn = "f6c177";
urgent = "eb6f92";
link = "9ccfd8";
highlight = "c4a7e7";
hialt0 = "f6c177";
hialt1 = "c4a7e7";
hialt2 = "f6c177";
pfg-confirm = "f0f0f3";
pfg-warn = "191724";
pfg-urgent = "191724";
pfg-link = "191724";
pfg-highlight = "191724";
pfg-hialt0 = "191724";
pfg-hialt1 = "191724";
pfg-hialt2 = "191724";
};
};
};
});
};
}