-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
243 lines (236 loc) · 7.41 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
{
description = "My NixOS";
nixConfig = {
# I am still not exactly sure what the point of these are...
# they do not affect nix.conf
# read more at:
# https://github.com/NixOS/nix/issues/6672
# https://github.com/NixOS/nix/issues/5988
# There also seems to be some difference using "extra"
# https://github.com/NixOS/nix/issues/6672#issuecomment-1921937241
extra-trusted-substituters = [
"https://nix-community.cachix.org"
"https://devenv.cachix.org"
];
extra-trusted-public-keys = [
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
"devenv.cachix.org-1:w1cLUi8dv3hnoSPGAuibQv+f9TZLr6cv/Hm9XgU50cw="
];
};
inputs = {
# TODO: figure out how to use from misterio and vimjoyer
# impermanence.url = "github:nix-community/impermanence";
# nix-colors.url = "github:misterio77/nix-colors";
alacritty-theme = {
url = "github:alexghr/alacritty-theme.nix";
inputs.nixpkgs.follows = "nixpkgs";
};
nix-homebrew.url = "github:zhaofengli-wip/nix-homebrew";
# Optional: Declarative tap management
homebrew-core = {
url = "github:homebrew/homebrew-core";
flake = false;
};
homebrew-cask = {
url = "github:homebrew/homebrew-cask";
flake = false;
};
homebrew-bundle = {
url = "github:homebrew/homebrew-bundle";
flake = false;
};
nix-darwin = {
url = "github:LnL7/nix-darwin";
inputs.nixpkgs.follows = "nixpkgs";
};
hardware = {
url = "github:nixos/nixos-hardware";
};
ctpv = {
url = "github:xav-ie/ctpv-nix";
inputs.nixpkgs.follows = "nixpkgs";
};
home-manager = {
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
};
hyprland = {
url = "git+https://github.com/hyprwm/Hyprland?submodules=1";
inputs.nixpkgs.follows = "nixpkgs";
};
hyprland-contrib = {
url = "github:hyprwm/contrib";
inputs.nixpkgs.follows = "nixpkgs";
};
generate-kaomoji = {
url = "github:xav-ie/generate-kaomoji";
inputs.nixpkgs.follows = "nixpkgs";
};
ghostty.url = "git+ssh://[email protected]/ghostty-org/ghostty";
ollama = {
url = "github:abysssol/ollama-flake";
};
nixpkgs = {
url = "github:nixos/nixpkgs/nixos-unstable";
};
nixpkgs-stable = {
url = "github:nixos/nixpkgs/nixos-23.11";
};
nur = {
url = "github:nix-community/NUR";
};
waybar = {
url = "github:Alexays/waybar";
inputs.nixpkgs.follows = "nixpkgs";
};
wezterm = {
url = "github:wez/wezterm?dir=nix";
inputs.nixpkgs.follows = "nixpkgs";
};
zjstatus = {
url = "github:dj95/zjstatus";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs =
{
home-manager,
nixpkgs,
self,
...
}@inputs:
let
inherit (self) outputs;
systems = [
"x86_64-linux"
"aarch64-darwin"
];
lib = nixpkgs.lib // home-manager.lib;
pkgsFor = lib.genAttrs systems (
system:
import nixpkgs {
inherit system;
config.allowUnfree = true;
}
);
forEachSystem = f: lib.genAttrs systems (system: f pkgsFor.${system});
in
{
# TODO: make the import of this global like misterio
overlays = import ./overlays { inherit inputs outputs; };
packages = forEachSystem (pkgs: import ./pkgs { inherit pkgs; });
formatter = forEachSystem (pkgs: pkgs.nixfmt-rfc-style);
# Reusable nixos modules you might want to export
# TODO: refactor these into proper, shareable modules
# 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;
nixosConfigurations = {
# custom desktop tower
praesidium = nixpkgs.lib.nixosSystem {
specialArgs = {
inherit inputs outputs;
};
modules = [
./hosts/praesidium
home-manager.nixosModules.home-manager
{
home-manager = {
extraSpecialArgs = {
inherit inputs outputs;
};
useGlobalPkgs = true;
useUserPackages = true;
users.x.imports = [
./modules/home-manager
./modules/home-manager/linux
];
};
}
];
};
};
darwinConfigurations = {
# macbook air - m1
castra = inputs.nix-darwin.lib.darwinSystem {
system = "aarch64-darwin";
specialArgs = {
inherit inputs outputs;
};
modules = [
./hosts/castra
home-manager.darwinModules.home-manager
{
home-manager = {
extraSpecialArgs = {
inherit inputs outputs;
};
useGlobalPkgs = true;
useUserPackages = true;
users.xavierruiz.imports = [
./modules/home-manager
./modules/home-manager/darwin
];
};
}
];
};
# macbook air - m3
stella = inputs.nix-darwin.lib.darwinSystem {
system = "aarch64-darwin";
specialArgs = {
inherit inputs outputs;
};
modules = [
./hosts/stella
# TODO: clean this up
inputs.nix-homebrew.darwinModules.nix-homebrew
{
nix-homebrew = {
# Install Homebrew under the default prefix
enable = true;
# Apple Silicon Only: Also install Homebrew under the default Intel prefix for Rosetta 2
enableRosetta = true;
# User owning the Homebrew prefix
# TODO: make this inherit from user variable
user = "x";
# Optional: Declarative tap management
taps = {
"homebrew/homebrew-core" = inputs.homebrew-core;
"homebrew/homebrew-cask" = inputs.homebrew-cask;
"homebrew/homebrew-bundle" = inputs.homebrew-bundle;
};
# Optional: Enable fully-declarative tap management
# With mutableTaps disabled, taps can no longer be added imperatively with `brew tap`.
mutableTaps = false;
};
}
(
{ config, ... }:
{
# https://github.com/zhaofengli/nix-homebrew/issues/5
# You must tell nix-darwin to just inherit the same taps as nix-homebrew
homebrew.taps = builtins.attrNames config.nix-homebrew.taps;
}
)
home-manager.darwinModules.home-manager
{
home-manager = {
extraSpecialArgs = {
inherit inputs outputs;
};
useGlobalPkgs = true;
useUserPackages = true;
users.x.imports = [
./modules/home-manager
./modules/home-manager/darwin
];
};
}
];
};
};
};
}