-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflake.nix
239 lines (237 loc) · 6.83 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
{
description = "my main flake";
inputs = {
# Core Nix Packages and Flakes
flake-parts.url = "github:hercules-ci/flake-parts";
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
# nixpkgs.url = "github:nixos/nixpkgs";
nixos-wsl.url = "github:nix-community/NixOS-WSL/main";
home-manager = {
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
};
#Used exclusively for firefox
nur.url = "github:nix-community/NUR";
#Boot
##Secure boot
lanzaboote = {
url = "github:nix-community/lanzaboote/v0.4.2";
inputs.nixpkgs.follows = "nixpkgs";
};
##Disk allocation
disko = {
url = "github:nix-community/disko";
inputs.nixpkgs.follows = "nixpkgs";
};
# Development Tools and Utilities
## Pre-commit hooks for Git
pre-commit-hooks.url = "github:cachix/git-hooks.nix";
##lsp
nixd.url = "github:nix-community/nixd";
sops-nix = {
url = "github:Mic92/sops-nix";
inputs.nixpkgs.follows = "nixpkgs";
};
solaar = {
url = "github:svenum/solaar-flake/main";
inputs.nixpkgs.follows = "nixpkgs";
};
# Wayland and GUI Tools
nixpkgs-wayland = {
url = "github:nix-community/nixpkgs-wayland";
inputs.nixpkgs.follows = "nixpkgs";
};
##Hyprland
hyprland.url = "github:hyprwm/Hyprland";
hy3 = {
url = "github:outfoxxed/hy3";
inputs.hyprland.follows = "hyprland";
};
hyprpanel.url = "github:Jas-SinghFSU/HyprPanel";
nixcord.url = "github:kaylorben/nixcord";
stylix.url = "github:danth/stylix";
#Terminal
nh.url = "github:viperML/nh";
# firefox-addons = {
# url = "gitlab:rycee/nur-expressions?dir=pkgs/firefox-addons";
# inputs.nixpkgs.follows = "nixpkgs";
# };
yazi.url = "github:sxyazi/yazi";
ghostty.url = "github:ghostty-org/ghostty";
## Neovim Configurations and Overlays
# nvimconfig.url = "github:DockterTeagle/mynvimconfig";
neovim-nightly-overlay.url = "github:nix-community/neovim-nightly-overlay";
};
outputs =
{
home-manager,
nixpkgs,
flake-parts,
...
}@inputs:
let
systemSettings = {
system = "x86_64-linux";
hostName = "nixos";
timezone = "America/Chicago";
WSL = false;
};
SystemModules = with inputs; [
./configuration.nix
hyprland.nixosModules.default
solaar.nixosModules.default
lanzaboote.nixosModules.lanzaboote
stylix.nixosModules.stylix
disko.nixosModules.disko
];
pkgs = import nixpkgs {
inherit (systemSettings) system;
config = {
allowUnfreePredicate =
pkg:
(builtins.elem (nixpkgs.lib.getName pkg) [
"nvidia-x11"
"discord"
"steam-unwrapped"
"steam"
"nvidia_driver"
"xow_dongle-firmware"
"obsidian"
"spotify"
# "rar"
# "unrar"
"intel-ocl"
"nvidia-settings"
"fakespot-fake-reviews-amazon"
"onetab"
]);
allowSubstitutes = false;
};
overlays = with inputs; [
neovim-nightly-overlay.overlays.default
nixpkgs-wayland.overlay
nur.overlays.default
nh.overlays.default
hyprpanel.overlay
yazi.overlays.default
];
};
cdockterSettings = {
username = "cdockter";
description = "Christopher Ryan Dockter";
email = "[email protected]";
wm = "hyprland";
term = "ghostty";
editor = "nvim";
font = "JetBrainsMono NF";
nerdfont = "jetbrains-mono";
homeDirectory = "/home/cdockter";
cursorPackage = pkgs.bibata-cursors;
cursorName = "Bibata-Modern-Ice";
};
in
flake-parts.lib.mkFlake { inherit inputs; } {
systems = [ "x86_64-linux" ];
debug = true;
flake = {
nixosConfigurations = {
isoImage = nixpkgs.lib.nixosSystem {
inherit (systemSettings) system;
modules = nixpkgs.lib.concatLists [
SystemModules
[
"${nixpkgs}/nixos/modules/installer/cd-dvd/installation-cd-minimal.nix"
"${nixpkgs}/nixos/modules/installer/cd-dvd/channel.nix"
]
];
specialArgs = {
inherit
inputs
systemSettings
cdockterSettings
;
};
};
NixOS-WSL = nixpkgs.lib.nixosSystem {
specialArgs = {
inherit
inputs
systemSettings
cdockterSettings
;
};
modules = [
inputs.nixos-wsl.nixosModules.default
./configuration.nix
inputs.stylix.nixosModules.stylix
{
system.stateVersion = "24.05";
wsl.enable = true;
}
];
};
nixos = nixpkgs.lib.nixosSystem {
inherit pkgs;
specialArgs = {
inherit
inputs
systemSettings
cdockterSettings
;
};
modules = SystemModules;
};
};
homeConfigurations = {
cdockter = home-manager.lib.homeManagerConfiguration {
inherit pkgs;
extraSpecialArgs = {
inherit inputs cdockterSettings systemSettings;
};
modules = with inputs; [
./home/cdockter/home.nix
stylix.homeManagerModules.stylix
hyprpanel.homeManagerModules.hyprpanel
nixcord.homeManagerModules.nixcord
];
};
};
};
perSystem =
{
inputs',
self',
pkgs,
system,
...
}:
{
devShells.default = pkgs.mkShell {
inherit (self'.checks.pre-commit-check) shellHook;
packages = with pkgs; [
self'.checks.pre-commit-check.enabledPackages
statix
inputs'.nixd.packages.nixd
#formatters
beautysh
yq
gitlint
marksman
ltex-ls-plus
];
};
formatter = pkgs.nixfmt-rfc-style;
checks = {
pre-commit-check = inputs.pre-commit-hooks.lib.${system}.run {
src = ./.;
hooks = {
nixfmt-rfc-style.enable = true;
statix.enable = true;
flake-checker.enable = true;
deadnix.enable = true;
};
};
};
};
};
}