-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathflake.nix
More file actions
133 lines (116 loc) · 3.25 KB
/
flake.nix
File metadata and controls
133 lines (116 loc) · 3.25 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
122
123
124
125
126
127
128
129
130
131
132
133
{
description = "reo101's Neovim configuration";
inputs = {
nixpkgs = {
url = "github:NixOS/nixpkgs/nixos-unstable";
};
systems = {
url = "github:nix-systems/default";
};
flake-parts = {
url = "github:hercules-ci/flake-parts";
inputs.nixpkgs-lib.follows = "nixpkgs";
};
neovim-nightly-overlay = {
url = "github:nix-community/neovim-nightly-overlay";
inputs.nixpkgs.follows = "nixpkgs";
};
nix-wrapper-modules = {
url = "github:BirdeeHub/nix-wrapper-modules";
inputs.nixpkgs.follows = "nixpkgs";
};
nix-lib-net = {
url = "github:reo101/nix-lib-net";
};
fennel-src = {
url = "github:reo101/Fennel/feat/discard";
flake = false;
};
cornelis = {
url = "github:isovector/cornelis";
inputs.nixpkgs.follows = "nixpkgs";
};
};
nixConfig = {
extra-substituters = [
"https://nix-community.cachix.org"
];
extra-trusted-public-keys = [
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
];
};
outputs =
inputs:
inputs.flake-parts.lib.mkFlake { inherit inputs; } (
{ withSystem, lib, ... }:
let
fs = lib.fileset;
# Define the config files once, reused in both flakeModules and perSystem
configFiles = fs.unions [
./.nfnl.fnl
./init.fnl
./init.lua
./fnl
./lua
./after
./syntax
./lsp
./luasnippets
];
in
{
systems = import inputs.systems.outPath;
imports = [
# Reovim-specific configuration
./nix/flake/reovim.nix
];
perSystem =
{
lib,
pkgs,
self',
...
}:
{
packages = {
fennel = pkgs.callPackage ./nix/pkgs/fennel.nix {
lua = pkgs.luajit;
src = inputs.fennel-src;
};
luajitcoroutineclone = pkgs.callPackage ./nix/pkgs/luajitcoroutineclone/default.nix { };
};
devShells.default = pkgs.callPackage ./nix/shells/default/default.nix { };
apps = {
reovim = {
type = "app";
program = "${self'.packages.reovim}/bin/nvim";
};
default = self'.apps.reovim;
};
formatter = pkgs.nixfmt;
};
flake = {
inherit configFiles;
flakeModules.reovim =
let
configSource = fs.toSource {
root = ./.;
fileset = configFiles;
};
in
inputs.nix-wrapper-modules.lib.evalModule {
imports = [ inputs.nix-wrapper-modules.lib.wrapperModules.neovim ];
# Convert the source to a string path for Lua concatenation
config.settings.config_directory = "${configSource}";
};
nixosModules = {
default = inputs.self.nixosModules.reovim;
reovim = inputs.nix-wrapper-modules.lib.mkInstallModule {
name = "reovim";
value = inputs.self.flakeModules.reovim;
};
};
};
}
);
}