| 
									
										
										
										
											2024-07-07 22:50:46 -04:00
										 |  |  | { | 
					
						
							|  |  |  |   inputs, | 
					
						
							|  |  |  |   outputs, | 
					
						
							|  |  |  |   systems, | 
					
						
							|  |  |  | }: | 
					
						
							| 
									
										
										
										
											2024-04-17 20:51:36 -04:00
										 |  |  | let | 
					
						
							| 
									
										
										
										
											2024-07-07 22:50:46 -04:00
										 |  |  |   inherit (inputs.nixpkgs) lib; | 
					
						
							| 
									
										
										
										
											2024-07-07 20:52:04 -04:00
										 |  |  |   pkgs = inputs.nixpkgs.legacyPackages.x86_64-linux; | 
					
						
							| 
									
										
										
										
											2024-04-17 20:51:36 -04:00
										 |  |  | 
 | 
					
						
							|  |  |  |   getCfg = _: cfg: cfg.config.system.build.toplevel; | 
					
						
							| 
									
										
										
										
											2024-07-07 21:26:24 -04:00
										 |  |  |   hostToAgg = _: cfg: cfg; | 
					
						
							| 
									
										
										
										
											2024-07-07 22:50:46 -04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2025-07-08 01:10:59 -04:00
										 |  |  |   getHome = _: cfg: cfg.config.home.activationPackage; | 
					
						
							|  |  |  |   homeToAgg = _: cfg: cfg; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-07-07 22:50:46 -04:00
										 |  |  |   # get per-system check derivation (with optional postfix) | 
					
						
							|  |  |  |   mapSystems = | 
					
						
							|  |  |  |     { | 
					
						
							|  |  |  |       check, | 
					
						
							|  |  |  |       postfix ? "", | 
					
						
							|  |  |  |     }: | 
					
						
							|  |  |  |     (map (system: if postfix == "" then check.${system} else check.${system}.${postfix}) systems); | 
					
						
							| 
									
										
										
										
											2024-04-17 20:51:36 -04:00
										 |  |  | in | 
					
						
							| 
									
										
										
										
											2024-07-07 21:07:06 -04:00
										 |  |  | rec { | 
					
						
							| 
									
										
										
										
											2024-07-07 20:52:04 -04:00
										 |  |  |   inherit (outputs) formatter devShells checks; | 
					
						
							| 
									
										
										
										
											2024-07-07 21:07:06 -04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-07-07 22:50:46 -04:00
										 |  |  |   host = lib.mapAttrs getCfg outputs.nixosConfigurations; | 
					
						
							| 
									
										
										
										
											2025-07-08 01:10:59 -04:00
										 |  |  |   home = lib.mapAttrs getHome outputs.homeConfigurations; # homeConfigurations.alice.config.home.activationPackage | 
					
						
							| 
									
										
										
										
											2024-07-07 21:26:24 -04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-07-07 20:52:04 -04:00
										 |  |  |   hosts = pkgs.releaseTools.aggregate { | 
					
						
							|  |  |  |     name = "hosts"; | 
					
						
							| 
									
										
										
										
											2024-07-07 22:50:46 -04:00
										 |  |  |     constituents = lib.mapAttrsToList hostToAgg host; | 
					
						
							| 
									
										
										
										
											2024-07-07 20:52:04 -04:00
										 |  |  |   }; | 
					
						
							| 
									
										
										
										
											2025-07-08 01:10:59 -04:00
										 |  |  |   homes = pkgs.releaseTools.aggregate { | 
					
						
							|  |  |  |     name = "homes"; | 
					
						
							|  |  |  |     constituents = lib.mapAttrsToList homeToAgg home; | 
					
						
							|  |  |  |   }; | 
					
						
							| 
									
										
										
										
											2024-07-07 21:41:40 -04:00
										 |  |  | 
 | 
					
						
							|  |  |  |   devChecks = pkgs.releaseTools.aggregate { | 
					
						
							|  |  |  |     name = "devChecks"; | 
					
						
							| 
									
										
										
										
											2024-07-07 22:50:46 -04:00
										 |  |  |     constituents = lib.flatten [ | 
					
						
							|  |  |  |       (mapSystems { check = formatter; }) | 
					
						
							|  |  |  |       (mapSystems { | 
					
						
							|  |  |  |         check = checks; | 
					
						
							|  |  |  |         postfix = "pre-commit-check"; | 
					
						
							|  |  |  |       }) | 
					
						
							|  |  |  |       (mapSystems { | 
					
						
							|  |  |  |         check = devShells; | 
					
						
							|  |  |  |         postfix = "default"; | 
					
						
							|  |  |  |       }) | 
					
						
							| 
									
										
										
										
											2024-07-07 21:41:40 -04:00
										 |  |  |     ]; | 
					
						
							|  |  |  |   }; | 
					
						
							| 
									
										
										
										
											2024-04-17 20:51:36 -04:00
										 |  |  | } |