forked from jan-leila/nix-config
		
	added util to lib
This commit is contained in:
		
							parent
							
								
									dd6046af27
								
							
						
					
					
						commit
						2d6b16950b
					
				
					 3 changed files with 17 additions and 12 deletions
				
			
		
							
								
								
									
										11
									
								
								flake.nix
									
										
									
									
									
								
							
							
						
						
									
										11
									
								
								flake.nix
									
										
									
									
									
								
							|  | @ -67,13 +67,14 @@ | |||
|       "x86_64-linux" | ||||
|     ]; | ||||
|     forEachPkgs = lambda: forEachSystem (system: lambda nixpkgs.legacyPackages.${system}); | ||||
|   in { | ||||
|     packages = forEachPkgs (pkgs: import ./pkgs {inherit pkgs;}); | ||||
| 
 | ||||
|     callPackage = nixpkgs.lib.callPackageWith (nixpkgs // { lib = lib; }); | ||||
|     lib = callPackage ./util {} // nixpkgs.lib; | ||||
|   in { | ||||
|     nixosConfigurations = { | ||||
|       # Leyla Laptop | ||||
|       horizon = nixpkgs.lib.nixosSystem { | ||||
|         specialArgs = {inherit inputs;}; | ||||
|         specialArgs = {inherit inputs lib;}; | ||||
|         modules = [ | ||||
|           home-manager.nixosModules.home-manager home-manager-config | ||||
|           ./hosts/horizon/configuration.nix | ||||
|  | @ -82,7 +83,7 @@ | |||
|       }; | ||||
|       # Leyla Desktop | ||||
|       twilight = nixpkgs.lib.nixosSystem { | ||||
|         specialArgs = {inherit inputs;}; | ||||
|         specialArgs = {inherit inputs lib;}; | ||||
|         modules = [ | ||||
|           home-manager.nixosModules.home-manager home-manager-config | ||||
|           ./hosts/twilight/configuration.nix | ||||
|  | @ -90,7 +91,7 @@ | |||
|       }; | ||||
|       # NAS Service | ||||
|       defiant = nixpkgs.lib.nixosSystem { | ||||
|         specialArgs = {inherit inputs;}; | ||||
|         specialArgs = {inherit inputs lib;}; | ||||
|         modules = [ | ||||
|           disko.nixosModules.disko | ||||
|           home-manager.nixosModules.home-manager home-manager-config | ||||
|  |  | |||
|  | @ -23,7 +23,7 @@ in { | |||
|         extraGroups = lib.mkMerge [ | ||||
|           ["networkmanager" "wheel"] | ||||
|           ( | ||||
|             lib.mkIf (!cfg.isThinUser) ["adbusers"] | ||||
|             lib.mkUnless cfg.isThinUser ["adbusers"] | ||||
|           ) | ||||
|         ]; | ||||
| 
 | ||||
|  |  | |||
|  | @ -1,7 +1,11 @@ | |||
| _: { | ||||
|   # mkUnless = condition: then: (mkIf (!condition) then); | ||||
|   # mkIfElse = condition: then: else: lib.mkMerge [ | ||||
|   #   (mkIf condition then) | ||||
|   #   (mkUnless condition else) | ||||
|   # ]; | ||||
| { | ||||
|   lib, | ||||
|   ... | ||||
| }: | ||||
| { | ||||
|   mkUnless = condition: yes: (lib.mkIf (!condition) yes); | ||||
|   mkIfElse = condition: yes: no: lib.mkMerge [ | ||||
|     (lib.mkIf condition yes) | ||||
|     (lib.mkUnless condition no) | ||||
|   ]; | ||||
| } | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue