File tree 1 file changed +24
-4
lines changed
1 file changed +24
-4
lines changed Original file line number Diff line number Diff line change @@ -165,10 +165,30 @@ let
165
165
;
166
166
167
167
# Adds the perSystem argument to the NixOS and Darwin modules
168
+ perSystemArgsModule = system : {
169
+ _module . args . perSystem = systemArgs . ${ system } . perSystem ;
170
+ } ;
171
+
172
+ # Shares pkgs with flake's, to avoid multiple nixpkgs reevaluations
168
173
perSystemModule =
169
- { pkgs , ... } :
174
+ { config , lib , ... } :
175
+ {
176
+ imports = [ ( perSystemArgsModule config . nixpkgs . hostPlatform . system ) ] ;
177
+ nixpkgs . pkgs = lib . mkDefault systemArgs . ${ config. nixpkgs . hostPlatform . system } . pkgs ;
178
+ } ;
179
+
180
+ # Same thing for home-manager
181
+ perSystemHMModule =
182
+ { osConfig , ... } :
170
183
{
171
- _module . args . perSystem = systemArgs . ${ pkgs. system } . perSystem ;
184
+ imports = [ ( perSystemArgsModule osConfig . nixpkgs . hostPlatform . system ) ] ;
185
+ } ;
186
+
187
+ # Same thing for system manager
188
+ perSystemSMModule =
189
+ { config , lib , ... } :
190
+ {
191
+ imports = [ ( perSystemArgsModule config . nixpkgs . hostPlatform ) ] ;
172
192
} ;
173
193
174
194
home-manager =
201
221
{ perSystem , config , ... } :
202
222
{
203
223
imports = [ homeManagerModule ] ;
204
- home-manager . sharedModules = [ perSystemModule ] ;
224
+ home-manager . sharedModules = [ perSystemHMModule ] ;
205
225
home-manager . extraSpecialArgs = specialArgs ;
206
226
home-manager . users = homesNested . ${ hostname } ;
207
227
home-manager . useGlobalPkgs = lib . mkDefault true ;
352
372
class = "system-manager" ;
353
373
value = system-manager . lib . makeSystemConfig {
354
374
modules = [
355
- perSystemModule
375
+ perSystemSMModule
356
376
path
357
377
] ;
358
378
extraSpecialArgs = specialArgs ;
You can’t perform that action at this time.
0 commit comments