-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflake.nix
188 lines (177 loc) · 5.54 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
{
description = "NixOS configuration";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
nixpkgs-stable.url = "github:nixos/nixpkgs/nixos-24.11";
disko.url = "github:nix-community/disko";
disko.inputs.nixpkgs.follows = "nixpkgs";
# home-manager, used for managing user configuration
home-manager = {
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
};
# Declarative Nix Flatpaks
flatpaks.url = "github:gmodena/nix-flatpak";
# VS Code extensions
nix-vscode-extensions = {
url = "github:nix-community/nix-vscode-extensions";
inputs.nixpkgs.follows = "nixpkgs";
};
# Firefox extensions
firefox-extensions = {
url = "gitlab:rycee/nur-expressions?dir=pkgs/firefox-addons";
inputs.nixpkgs.follows = "nixpkgs";
};
# https://github.com/danth/stylix
stylix = {
url = "github:danth/stylix";
};
# Catppuccin theme
# https://github.com/catppuccin/nix
catppuccin.url = "github:catppuccin/nix";
# Catppuccin theme for VSCodium
# https://github.com/catppuccin/vscode
catppuccin-vsc.url = "https://flakehub.com/f/catppuccin/vscode/*.tar.gz";
nixvim = {
url = "github:nix-community/nixvim";
inputs.nixpkgs.follows = "nixpkgs";
};
umu = {
url = "git+https://github.com/Open-Wine-Components/umu-launcher/?dir=packaging\/nix&submodules=1";
inputs.nixpkgs.follows = "nixpkgs";
};
# Motherboard support in latest experimental
# Update to stable release later
openrgb-experimental = {
url = "gitlab:CalcProgrammer1/OpenRGB";
flake = false;
};
};
outputs =
inputs@{
nixpkgs-stable,
nixpkgs,
disko,
home-manager,
stylix,
catppuccin,
catppuccin-vsc,
flatpaks,
nixvim,
...
}:
let
system = "x86_64-linux";
username = "artur";
lib = nixpkgs.lib;
overlays = [
catppuccin-vsc.overlays.default
];
pkgs = import nixpkgs {
inherit system overlays;
config.allowUnfree = true;
};
pkgs-stable = import nixpkgs-stable {
inherit system overlays;
config = {
allowUnfree = true;
};
};
in
{
nixosConfigurations = {
asus-laptop = lib.nixosSystem {
inherit system;
specialArgs = {
flake-inputs = inputs;
inherit username;
inherit pkgs;
inherit pkgs-stable;
};
modules = [
./hosts/asus-laptop/configuration.nix
disko.nixosModules.disko
flatpaks.nixosModules.nix-flatpak
# make home-manager as a module of nixos
# so that home-manager configuration will be deployed automatically when executing `nixos-rebuild switch`
home-manager.nixosModules.home-manager
stylix.nixosModules.stylix
{
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.users."${username}".imports = [
nixvim.homeManagerModules.nixvim
./hosts/asus-laptop/home.nix
];
# Optionally, use home-manager.extraSpecialArgs to pass arguments to home.nix
home-manager.extraSpecialArgs = {
flake-inputs = inputs;
inherit pkgs-stable;
inherit username;
};
}
];
};
desktop = lib.nixosSystem {
inherit system;
specialArgs = {
flake-inputs = inputs;
inherit username;
inherit pkgs;
inherit pkgs-stable;
};
modules = [
./hosts/desktop/configuration.nix
disko.nixosModules.disko
# make home-manager as a module of nixos
# so that home-manager configuration will be deployed automatically when executing `nixos-rebuild switch`
home-manager.nixosModules.home-manager
stylix.nixosModules.stylix
{
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.users."${username}".imports = [
nixvim.homeManagerModules.nixvim
./hosts/desktop/home.nix
];
# Optionally, use home-manager.extraSpecialArgs to pass arguments to home.nix
home-manager.extraSpecialArgs = {
flake-inputs = inputs;
inherit pkgs-stable;
inherit username;
};
}
];
};
homelab-services = lib.nixosSystem {
inherit system;
specialArgs = {
flake-inputs = inputs;
inherit username;
inherit pkgs;
inherit pkgs-stable;
};
modules = [
./hosts/homelab-services/configuration.nix
./hosts/homelab-services/hardware-configuration.nix
disko.nixosModules.disko
];
};
};
homeConfigurations."ty" = home-manager.lib.homeManagerConfiguration {
inherit pkgs;
extraSpecialArgs = {
flake-inputs = inputs;
inherit username;
inherit pkgs-stable;
inherit overlays;
};
modules = [
./hosts/ty/home.nix
catppuccin.homeManagerModules.catppuccin
stylix.homeManagerModules.stylix
nixvim.homeManagerModules.nixvim
];
};
};
}