-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
51 lines (44 loc) · 1.32 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
{
description = "Nix bindings for creating and sharing neovim configurations";
inputs.nixpkgs.url = "github:nixos/nixpkgs";
outputs = {
self,
nixpkgs,
...
}: let
mkModule = import ./mkModule.nix;
eachSystem = f:
nixpkgs.lib.genAttrs [
"aarch64-darwin"
"aarch64-linux"
"x86_64-darwin"
"x86_64-linux"
] (system: let pkgs = import nixpkgs {inherit system;}; in f {inherit system pkgs;});
in {
homeManagerModules.nvim = mkModule {};
homeManagerModules.default = self.homeManagerModules.nvim;
nixosModules.nvim = mkModule {nixos = true;};
nixosModules.default = self.nixosModules.nvim;
lib.baseModules = let
modules = import ./modules;
recurseAttrValuesToList = list:
builtins.map (
v:
if builtins.typeOf v == "set"
then recurseAttrValuesToList (nixpkgs.lib.attrValues v)
else v
)
list;
moduleList = nixpkgs.lib.flatten (recurseAttrValuesToList (nixpkgs.lib.attrValues modules));
in
{
all = {imports = moduleList;};
}
// modules;
lib.mkNvimPkg = import ./package;
formatter = eachSystem ({pkgs, ...}: pkgs.alejandra);
devShells = eachSystem ({pkgs, ...}: {
default = import ./shell.nix {inherit pkgs;};
});
};
}