-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflake.nix
196 lines (148 loc) · 5.32 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
# cd "/mnt/linux_shared/my_nix_flake"
# CONFIG=asus-gnome # example
# nixos-rebuild build --flake .#$CONFIG
# sudo nixos-rebuild switch --flake .#$CONFIG
# Resources
# https://www.tweag.io/blog/2020-07-31-nixos-flakes/
# https://www.youtube.com/watch?v=mJbQ--iBc1U&t=1094s
# https://github.com/novoid/nixos-config/blob/main/flake.nix
# https://discourse.nixos.org/t/flake-and-home-manager-20-11-configuration/20211/3
# https://www.youtube.com/watch?v=AGVXJ-TIv3Y
{
description = "My GNOME Nix config";
inputs = {
nixpkgs = {
url = "github:NixOS/nixpkgs/nixos-23.11";
};
# Unstable setup inspired from:
# https://www.reddit.com/r/NixOS/comments/klbuu2/unstable_packages_in_configurationnix_using_flakes/
nixpkgs-unstable.url = "nixpkgs/nixos-unstable";
home-manager = {
url = "github:nix-community/home-manager/release-23.11";
inputs.nixpkgs.follows = "nixpkgs";
};
xremap-flake.url = "github:xremap/nix-flake";
};
outputs = { self, nixpkgs, nixpkgs-unstable, home-manager, ... }@inputs:
let
system = "x86_64-linux";
overlay-unstable = final: prev: {
unstable = nixpkgs-unstable.legacyPackages.${system};
};
pkgs = import nixpkgs {
inherit system;
config = {
allowUnfree = true;
permittedInsecurePackages = [
"electron-12.2.3"
"electron-19.1.9"
"python-2.7.18.7"
];
};
overlays = [ overlay-unstable ];
};
username = "sayantan";
stateVersion = "23.05";
in
{
nixosConfigurations = {
# ========================== HP ==========================
# For my HP x360, with GNOME 44.2
hp-gnome = nixpkgs.lib.nixosSystem {
inherit system;
specialArgs = { inherit username stateVersion pkgs inputs; };
modules = [
{ networking.hostName = "hp-gnome"; }
./hardware/hp-x360.nix
./system/common.nix
./system/gnome.nix
./misc/my_mount_points.nix
./misc/my_dev_stuff.nix
./misc/xremap.nix
home-manager.nixosModules.home-manager {
home-manager.extraSpecialArgs = { inherit username stateVersion inputs; };
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.users.${username} = {
home.stateVersion = stateVersion;
imports = [
./home/common.nix
./home/gnome.nix
./home/gnome.hp-x360.nix
./home/gnome.xremap.nix
];
};
}
];
};
hp-plasma = nixpkgs.lib.nixosSystem {
inherit system;
specialArgs = { inherit username stateVersion pkgs inputs home-manager; };
modules = [
{ networking.hostName = "hp-plasma"; }
# ========== configs specific to HP x360 ==========
./hardware/hp_x360.nix
./misc/my_mount_points.nix
# ====================
./general/configuration.nix
./plasma/configuration.nix
./misc/my_dev_stuff.nix
./xremap/configuration.nix
];
};
hp-hyprland = nixpkgs.lib.nixosSystem {
inherit system;
specialArgs = { inherit username stateVersion pkgs inputs; };
modules = [
{ networking.hostName = "hp-hyprland"; }
# ========== configs specific to HP x360 ==========
./hardware/hp_x360.nix
./misc/my_mount_points.nix
# ====================
./general/configuration.nix
./hyprland/configuration.nix
./misc/my_dev_stuff.nix
./xremap/configuration.nix
];
};
# ========================== ASUS ==========================
# For my ASUS X13, with GNOME 44.2
asus-gnome = nixpkgs.lib.nixosSystem {
inherit system;
specialArgs = { inherit username stateVersion pkgs inputs; };
modules = [
{ networking.hostName = "asus-gnome"; }
./hardware/asus-x13.nix
./system/asus-x13.nix
./system/common.nix
./system/gnome.nix
./misc/my_mount_points.nix
./misc/my_dev_stuff.nix
./misc/my_server.nix
./misc/xremap.nix
#./misc/distrobox.nix
#./misc/waydroid.nix
./misc/tailscale.nix
./misc/thefuck.nix
./misc/libvert.nix
home-manager.nixosModules.home-manager {
home-manager.extraSpecialArgs = { inherit username stateVersion inputs; };
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.users.${username} = {
home.stateVersion = stateVersion;
imports = [
./home/common.nix
./home/gnome.nix
./home/gnome.asus-x13.nix
./home/gnome.xremap.nix
./home/gnome.tailscale.nix
#./home/thefuck.nix
];
};
}
];
};
};
};
}