forked from cowboyliao/myflake
-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
276 lines (246 loc) · 8.99 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
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
{
description = "My new nix config";
# nix develop --option substituters "https://mirrors.ustc.edu.cn/nix-channels/store https://cache.nixos.org"
nixConfig = {
builders-use-substitutes = true;
experimental-features = ["nix-command" "flakes"];
substituters = [
"https://mirrors.ustc.edu.cn/nix-channels/store"
"https://mirror.sjtu.edu.cn/nix-channels/store"
"https://mirrors.tuna.tsinghua.edu.cn/nix-channels/store"
"https://cache.nixos.org/"
];
extra-substituters = [
"https://nix-community.cachix.org"
];
extra-trusted-public-keys = [
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
];
};
outputs = {
self,
nixpkgs,
home-manager,
# nix-xilinx,
...
} @ inputs: let
inherit (self) outputs;
forAllSystems = nixpkgs.lib.genAttrs [
"aarch64-linux"
"i686-linux"
"x86_64-linux"
"aarch64-darwin"
"x86_64-darwin"
];
userSetting = {
username = "leeao";
hostname = "nixos";
email = "[email protected]";
windowmanager = "hyprland";
# windowmanager = "plasma";
# windowmanager = "gnome";
colorscheme = "google-light";
# colorscheme = "github";
};
in {
# NixOS configuration entrypoint
# Available through 'nixos-rebuild --flake .#your-hostname'
nixosConfigurations = {
# FIXME replace with your hostname
${userSetting.hostname} = nixpkgs.lib.nixosSystem {
specialArgs = {inherit inputs outputs userSetting;};
modules = [
# > Our main nixos configuration file <
# You can import other NixOS modules here
# If you want to use modules your own flake exports (from modules/nixos):
# outputs.nixosModules.example
# inputs.hosts.nixosModule.networking
# Or modules from other flakes (such as nixos-hardware):
# inputs.hardware.nixosModules.cixpkgs-unstabommon-cpu-amd
# inputs.hardware.nixosModules.common-ssd
# You can also split up your configuration and import pieces of it here:
# Import home-manager's NixOS module
inputs.home-manager.nixosModules.home-manager
inputs.stylix.nixosModules.stylix
# Import modules
./nixos/modules
# Import your generated (nixos-generate-config) hardware configuration
./nixos/hardware-configuration.nix
];
};
};
# Your custom packages
# Acessible through 'nix build', 'nix shell', etc
packages = forAllSystems (
system: let
pkgs = nixpkgs.legacyPackages.${system};
in
import ./pkgs {inherit pkgs;}
);
# Devshell for bootstrapping
# Acessible through 'nix develop' or 'nix-shell' (legacy)
devShells = forAllSystems (
system: let
pkgs = nixpkgs.legacyPackages.${system};
in
import ./shell.nix {inherit pkgs;}
);
# Your custom packages and modifications, exported as overlays
overlays = import ./overlays {inherit inputs;};
# Reusable nixos modules you might want to export
# These are usually stuff you would upstream into nixpkgs
nixosModules = import ./modules/nixos;
# Reusable home-manager modules you might want to export
# These are usually stuff you would upstream into home-manager
homeManagerModules = import ./modules/home-manager;
};
inputs = {
ags.url = "github:Aylur/ags";
nixvim = {
url = "github:nix-community/nixvim";
# If using a stable channel you can use `url = "github:nix-community/nixvim/nixos-<version>"`
inputs.nixpkgs.follows = "nixpkgs";
};
emacs-overlay = {
url = "github:nix-community/emacs-overlay/master";
inputs.nixpkgs.follows = "nixpkgs-unstable";
inputs.nixpkgs-stable.follows = "nixpkgs";
inputs.flake-utils.follows = "flake-utils";
};
hy3 = {
url = "github:outfoxxed/hy3"; # where {version} is the hyprland release version
# or "github:outfoxxed/hy3" to follow the development branch.
# (you may encounter issues if you dont do the same for hyprland)
inputs.hyprland.follows = "hyprland";
};
nix-doom-emacs-unstraightened = {
url = "github:marienz/nix-doom-emacs-unstraightened";
# Optional, to download less. Neither the module nor the overlay uses this input.
inputs.nixpkgs.follows = "nixpkgs";
# inputs.systems.follows = "systems";
inputs.emacs-overlay.follows = "emacs-overlay";
};
daeuniverse.url = "github:daeuniverse/flake.nix";
# Nixpkgs
# nixpkgs.url = "github:nixos/nixpkgs/nixos-23.11";
nixpkgs.url = "github:nixOS/nixpkgs/nixos-unstable";
# You can access packages and modules from different nixpkgs revs
# at the same time. Here's an working example:
nixpkgs-unstable.url = "github:nixos/nixpkgs/nixos-unstable";
# Also see the 'unstable-packages' overlay at 'overlays/default.nix'.
hyprland.url = "git+https://github.com/hyprwm/Hyprland?submodules=1";
# helix.url = "github:helix-editor/helix/master";
xremap-flake.url = "github:xremap/nix-flake";
stylix.url = "github:danth/stylix";
stylix.inputs.nixpkgs.follows = "nixpkgs";
# Home manager
home-manager = {
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
};
hosts.url = "github:StevenBlack/hosts";
# nix-xilinx = {
# # Recommended if you also override the default nixpkgs flake, common among
# # nixos-unstable users:
# #inputs.nixpkgs.follows = "nixpkgs";
# url = "gitlab:doronbehar/nix-xilinx";
# };
firefox-addons = {
url = "gitlab:rycee/nur-expressions?dir=pkgs/firefox-addons";
inputs.nixpkgs.follows = "nixpkgs";
};
flake-utils.url = "github:numtide/flake-utils";
flake-parts.url = "github:hercules-ci/flake-parts";
# attic = {
# url = "github:zhaofengli/attic";
# inputs.flake-compat.follows = "flake-compat";
# inputs.flake-utils.follows = "flake-utils";
# inputs.nixpkgs.follows = "nixpkgs";
# inputs.nixpkgs-stable.follows = "nixpkgs-23-05";
# };
# agenix = {
# url = "github:ryantm/agenix";
# inputs.home-manager.follows = "home-manager";
# inputs.nixpkgs.follows = "nixpkgs";
# };
# cities-json = {
# url = "github:lutangar/cities.json";
# flake = false;
# };
# colmena = {
# url = "github:zhaofengli/colmena";
# inputs.flake-compat.follows = "flake-compat";
# inputs.flake-utils.follows = "flake-utils";
# inputs.nixpkgs.follows = "nixpkgs";
# inputs.stable.follows = "nixpkgs-23-05";
# };
# composer2nix = {
# url = "github:svanderburg/composer2nix";
# flake = false;
# };
# dwarffs = {
# url = "github:edolstra/dwarffs";
# inputs.nixpkgs.follows = "nixpkgs";
# };
# nil = {
# url = "github:oxalica/nil";
# inputs.nixpkgs.follows = "nixpkgs";
# inputs.flake-utils.follows = "flake-utils";
# };
# impermanence.url = "github:nix-community/impermanence";
# nix-alien = {
# url = "github:thiagokokada/nix-alien";
# inputs.flake-compat.follows = "flake-compat";
# inputs.flake-utils.follows = "flake-utils";
# inputs.nixpkgs.follows = "nixpkgs";
# };
# nix-math = {
# url = "github:xddxdd/nix-math";
# inputs.flake-parts.follows = "flake-parts";
# inputs.nixpkgs.follows = "nixpkgs";
# };
nur.url = "github:nix-community/NUR";
nur-xddxdd = {
# url = "/home/lantian/Projects/nur-packages";
url = "github:xddxdd/nur-packages";
inputs.nixpkgs.follows = "nixpkgs";
inputs.flake-parts.follows = "flake-parts";
inputs.nvfetcher.follows = "nvfetcher";
};
nvfetcher = {
url = "github:berberman/nvfetcher";
inputs.nixpkgs.follows = "nixpkgs";
inputs.flake-utils.follows = "flake-utils";
inputs.flake-compat.follows = "flake-compat";
};
nix-colors.url = "github:misterio77/nix-colors";
# secrets = {
# # url = "/home/lantian/Projects/nixos-secrets";
# url = "github:xddxdd/nixos-secrets";
# flake = false;
# };
# srvos = {
# url = "github:numtide/srvos";
# inputs.nixpkgs.follows = "nixpkgs";
# };
# terranix = {
# url = "github:terranix/terranix";
# inputs.nixpkgs.follows = "nixpkgs";
# inputs.flake-utils.follows = "flake-utils";
# };
# Common libraries
# nixpkgs-22-05.url = "github:NixOS/nixpkgs/nixos-22.05";
# nixpkgs-22-11.url = "github:NixOS/nixpkgs/nixos-22.11";
# nixpkgs-23-05.url = "github:NixOS/nixpkgs/nixos-23.05";
# nixpkgs-23-11.url = "github:NixOS/nixpkgs/nixos-23.11";
flake-compat = {
url = "github:edolstra/flake-compat";
flake = false;
};
# TODO: Add any other flake you might need
# hardware.url = "github:nixos/nixos-hardware";
# Shameless plug: looking for a way to nixify your themes and make
# everything match nicely? Try nix-colors!
# nix-colors.url = "github:misterio77/nix-colors";
};
}