-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflake.nix
182 lines (150 loc) · 5.95 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
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
# flake.nix
# Flake: Main flake file
# @see: /nix/flake
#
{
description = "Neovim - Batteries included";
inputs = {
# Crane
#
# A Nix library for building cargo projects. Never build twice
# thanks to incremental artifact caching.
#
# GitHub: https://github.com/ipetkov/crane
# crane.inputs.nixpkgs.follows = "nixpkgs";
crane.url = "github:ipetkov/crane";
# devenv
#
# Fast, Declarative, Reproducible, and Composable Developer Environments
# using Nix
#
# Homepage: https://devenv.sh/
# GitHub: https://github.com/cachix/devenv
devenv.inputs.flake-compat.follows = "flake-compat";
devenv.inputs.nix.follows = "nixpkgs";
devenv.inputs.nixpkgs.follows = "nixpkgs";
devenv.inputs.pre-commit-hooks.follows = "pre-commit-hooks-nix";
devenv.url = "github:cachix/devenv";
# TODO: remove linyinfeng to remove devshell - We use devenv
devshell.inputs.nixpkgs.follows = "nixpkgs";
# devshell.inputs.systems.follows = "systems";
devshell.url = "github:numtide/devshell";
flake-compat.flake = false;
flake-compat.url = "github:edolstra/flake-compat";
flake-parts.inputs.nixpkgs-lib.follows = "nixpkgs";
flake-parts.url = "github:hercules-ci/flake-parts";
flake-root.url = "github:srid/flake-root";
flake-utils.inputs.systems.follows = "systems";
flake-utils.url = "github:numtide/flake-utils";
# flat-flake
#
# Enforce flat flake inputs
#
# GitHub: https://github.com/linyinfeng/flat-flake
flat-flake.inputs.crane.follows = "crane";
flat-flake.inputs.flake-compat.follows = "flake-compat";
flat-flake.inputs.flake-parts.follows = "flake-parts";
flat-flake.inputs.flake-utils.follows = "flake-utils";
flat-flake.inputs.nixpkgs.follows = "nixpkgs";
flat-flake.inputs.rust-overlay.follows = "rust-overlay";
flat-flake.inputs.systems.follows = "systems";
flat-flake.inputs.treefmt-nix.follows = "treefmt-nix";
flat-flake.url = "github:linyinfeng/flat-flake";
gitignore-nix.inputs.nixpkgs.follows = "nixpkgs";
gitignore-nix.url = "github:hercules-ci/gitignore.nix";
# Haumea
#
# Filesystem-based module system for Nix
#
# GitHub: https://github.com/nix-community/haumea
haumea.inputs.nixpkgs.follows = "nixpkgs";
haumea.url = "github:nix-community/haumea";
latest.url = "github:nixos/nixpkgs/master";
#nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.11";
#nixpkgs.url = "github:NixOS/nixpkgs/latest";
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
#nixvim.url = "github:pta2002/nixvim?ref=36f2e51b28ee3389a67ed5e9ed5c4bd388b06918";
# nixvim.inputs.nixpkgs.follows = "unstable";
# nixvim.url = "github:pta2002/nixvim?ref=nixos-24.11";
# nixvim.url = "github:nix-community/nixvim?ref=nixos-24.11";
nixvim.url = "github:nix-community/nixvim?ref=main";
nixvim.inputs.nixpkgs.follows = "nixpkgs";
# nix-github-actions
#
# A library to turn Nix Flake attribute sets into Github Actions matrices
#
# GitHub: https://github.com/nix-community/nix-github-actions
#
# required by: poetry2nix
nix-github-actions.url = "github:nix-community/nix-github-actions";
nix-github-actions.inputs.nixpkgs.follows = "nixpkgs";
nvfetcher.inputs.flake-compat.follows = "flake-compat";
nvfetcher.inputs.flake-utils.follows = "flake-utils";
nvfetcher.inputs.nixpkgs.follows = "nixpkgs";
nvfetcher.url = "github:berberman/nvfetcher";
# poetry2nix
#
# Convert poetry projects to nix automagically
#
# GitHub: https://github.com/nix-community/poetry2nix
#
# Required by: nixvim
poetry2nix.url = "github:nix-community/poetry2nix";
poetry2nix.inputs.flake-utils.follows = "flake-utils";
poetry2nix.inputs.nixpkgs.follows = "nixpkgs";
poetry2nix.inputs.systems.follows = "systems";
poetry2nix.inputs.treefmt-nix.follows = "treefmt-nix";
poetry2nix.inputs.nix-github-actions.follows = "nix-github-actions";
pre-commit-hooks-nix.inputs.flake-compat.follows = "flake-compat";
pre-commit-hooks-nix.inputs.gitignore.follows = "gitignore-nix";
pre-commit-hooks-nix.inputs.nixpkgs-stable.follows = "nixpkgs";
pre-commit-hooks-nix.inputs.nixpkgs.follows = "nixpkgs";
pre-commit-hooks-nix.url = "github:cachix/pre-commit-hooks.nix";
rust-overlay.inputs.nixpkgs.follows = "nixpkgs";
rust-overlay.url = "github:oxalica/rust-overlay";
sops-nix.inputs.nixpkgs-stable.follows = "nixpkgs";
sops-nix.inputs.nixpkgs.follows = "nixpkgs";
sops-nix.url = "github:Mic92/sops-nix";
systems.url = "github:nix-systems/default";
# required by: flatflake, poetry2nix
treefmt-nix.inputs.nixpkgs.follows = "nixpkgs";
treefmt-nix.url = "github:numtide/treefmt-nix";
unstable.url = "github:nixos/nixpkgs/nixos-unstable";
};
outputs = inputs @ {
flake-parts,
nixpkgs,
...
}:
flake-parts.lib.mkFlake {inherit inputs;}
({
self,
lib,
...
}: let
selfLib = import ./nix/lib {inherit inputs lib;};
in {
# Alternative:
# systems = [ "x86_64-linux" "aarch64-linux" "aarch64-darwin" "x86_64-darwin" ];
# or more "minimal"
# systems = [ "x86_64-linux" "aarch64-linux" ];
# But we "use them all" ;-)
systems = lib.systems.flakeExposed;
flake.lib = selfLib;
imports =
[
inputs.devenv.flakeModule
inputs.flake-parts.flakeModules.easyOverlay
inputs.flake-root.flakeModule
inputs.flat-flake.flakeModules.flatFlake
# Install treefmt and set outputs.formatter.<system> to to treefmt
# Use `nix fmt` to format source tree
inputs.treefmt-nix.flakeModule
# Make sure that commits are well-formatted at commit time
# TODO: Check if renamed to git-hooks:
# <https://github.com/cachix/git-hooks.nix>
inputs.pre-commit-hooks-nix.flakeModule
]
++ selfLib.buildModuleList ./nix/flake;
});
}