-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
227 lines (198 loc) · 6.58 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
{
description = "andre-brandao NixOS configuration";
outputs =
{
self,
nixpkgs,
nixpkgs-unstable,
# nixos-hardware,
home-manager,
stylix,
...
}@inputs:
let
inherit (self) outputs;
# configure pkgs
pkgs = import nixpkgs {
system = systemSettings.system;
config = {
allowUnfree = true;
allowUnfreePredicate = _: true;
};
overlays = [
# inputs.hyprpanel.overlay
inputs.hyprland.overlays.default
# inputs.hyprshell.overlays.default
];
};
pkgs-unstable = import nixpkgs-unstable {
system = systemSettings.system;
config = {
allowUnfree = true;
allowUnfreePredicate = _: true;
};
};
# ---- SYSTEM SETTINGS ---- #
systemSettings = {
system = "x86_64-linux"; # system arch
hostname = "nixos"; # hostname
profile = "xps"; # select a host defined from hosts directory
timezone = "America/Sao_Paulo"; # select timezone
language = "en_US.UTF-8"; # select language
locale = "pt_BR.UTF-8"; # select locale
plymouthTheme = "lone"; # Check all themes on: https://github.com/NixOS/nixpkgs/blob/nixos-23.11/pkgs/data/themes/adi1090x-plymouth-themes/shas.nix
};
# ----- USER SETTINGS ----- #
userSettings = {
username = "andre"; # username
git-user = "andre-brandao";
name = "Andre Brandao"; # name/identifier
email = "[email protected]";
configDir = "/home/${userSettings.username}/dotfiles/nixos"; # absolute path of the local repo
theme = "miramare"; # selcted theme from my themes directory (./themes/)
wm = "hyprland"; # Selected window manager or desktop environment; must select one in both ./user/desk-env/ and ./system/desk-env/
browser = "zen";
term = "kitty"; # Default terminal command;
shell = "zsh"; # Default shell;
font = "JetBrains Mono"; # Selected font
fontPkg = pkgs.jetbrains-mono; # Font package
editor = "zed"; # Default editor;
};
stylixSettings = {
polarity = "dark";
image = "${inputs.wallpapers}/red-sunset.png";
base16Scheme = "${inputs.color-schemes}/base16/irblack.yaml";
fonts = {
sizes = {
terminal = 18;
applications = 12;
popups = 12;
desktop = 12;
};
monospace = {
name = userSettings.font;
package = userSettings.fontPkg;
};
serif = {
name = userSettings.font;
package = userSettings.fontPkg;
};
sansSerif = {
name = userSettings.font;
package = userSettings.fontPkg;
};
emoji = {
name = "Noto Color Emoji";
package = pkgs.noto-fonts-emoji-blob-bin;
};
};
};
in
{
formatter.${systemSettings.system} = pkgs.nixfmt-rfc-style;
# NixOS configuration entrypoint
# Available through 'nixos-rebuild --flake .#your-hostname'
nixosConfigurations = {
system = nixpkgs.lib.nixosSystem {
modules = [
./hosts/${systemSettings.profile}/configuration.nix
home-manager.nixosModules.home-manager
stylix.nixosModules.stylix
{
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.users.${userSettings.username} = import ./hosts/${systemSettings.profile}/home.nix;
home-manager.extraSpecialArgs = {
inherit pkgs-unstable;
inherit inputs outputs;
inherit systemSettings;
inherit userSettings;
inherit stylixSettings;
};
# Optionally, use home-manager.extraSpecialArgs to pass
# arguments to home.nix
}
];
specialArgs = {
inherit pkgs-unstable;
inherit inputs outputs;
inherit systemSettings;
inherit userSettings;
inherit stylixSettings;
};
};
};
# Standalone home-manager configuration entrypoint
# Available through 'home-manager --flake .#your-username@your-hostname'
homeConfigurations = {
user = home-manager.lib.homeManagerConfiguration {
inherit pkgs; # Home-manager requires 'pkgs' instance
modules = [
./hosts/${systemSettings.profile}/home.nix
];
extraSpecialArgs = {
inherit pkgs-unstable;
inherit inputs outputs;
inherit systemSettings;
inherit userSettings;
inherit stylixSettings;
};
};
};
};
inputs = {
# Nixpkgs
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
# nixpkgs.url = "github:nixos/nixpkgs/nixos-24.05";
nixpkgs-unstable.url = "github:NixOS/nixpkgs/nixos-unstable";
# nixos-hardware.url = "github:NixOS/nixos-hardware/master";
# Home manager
home-manager = {
# url = "github:nix-community/home-manager/release-24.05";
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
};
# HyperLand
hyprland = {
# url = "git+https://github.com/hyprwm/Hyprland?submodules=1";
# url = "git+https://github.com/hyprwm/Hyprland?tag=v0.45.0?submodules=1";
url = "github:hyprwm/Hyprland/v0.45.2";
# url = "github:hyprwm/Hyprland/v0.42.0";
# inputs.nixpkgs.follows = "nixpkgs-unstable";
};
hyprshell = {
url = "github:andre-brandao/hyprshell";
};
hyprland-plugins = {
url = "github:hyprwm/hyprland-plugins";
inputs.hyprland.follows = "hyprland";
};
hyprsysteminfo = {
url = "github:hyprwm/hyprsysteminfo";
inputs.nixpkgs.follows = "nixpkgs";
};
hyprgrass = {
url = "github:horriblename/hyprgrass";
inputs.hyprland.follows = "hyprland";
};
Hyprspace = {
url = "github:KZDKM/Hyprspace";
inputs.hyprland.follows = "hyprland";
};
# Stylix
stylix.url = "github:danth/stylix";
color-schemes = {
url = "github:andre-brandao/color-schemes";
flake = false;
};
wallpapers = {
url = "github:andre-brandao/wallpapers";
flake = false;
};
spicetify = {
url = "github:Gerg-L/spicetify-nix";
inputs.nixpkgs.follows = "nixpkgs";
};
zen-browser.url = "github:MarceColl/zen-browser-flake";
};
}