mirror of
				https://github.com/Jokiller230/puzzlevision.git
				synced 2025-10-31 05:40:05 +00:00 
			
		
		
		
	Compare commits
	
		
			3 commits
		
	
	
		
			e54b87a835
			...
			7d16e19c8b
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 7d16e19c8b | |||
| b559e046b7 | |||
| c322461fe1 | 
					 4 changed files with 55 additions and 2 deletions
				
			
		|  | @ -16,7 +16,7 @@ | |||
|     }; | ||||
|   }; | ||||
| 
 | ||||
|   outputs = inputs@{ flake-parts, ... }: | ||||
|   outputs = { flake-parts, ... }@inputs: | ||||
|     flake-parts.lib.mkFlake { inherit inputs; } { | ||||
|       debug = true; | ||||
| 
 | ||||
|  |  | |||
							
								
								
									
										16
									
								
								lib/module/default.nix
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										16
									
								
								lib/module/default.nix
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,16 @@ | |||
| { | ||||
|   lib, | ||||
|   ... | ||||
| }: | ||||
| { | ||||
|   ## Create a NixOS module option as a one-liner. | ||||
|   ## | ||||
|   ## ```nix | ||||
|   ## lib.mkOpt nixpkgs.lib.types.str "My default" "Option description" | ||||
|   ## ``` | ||||
|   ## | ||||
|   #@ Type -> Any -> String | ||||
|   mkOpt = | ||||
|     type: default: description: | ||||
|     lib.mkOption { inherit type default description; }; | ||||
| } | ||||
|  | @ -1,13 +1,43 @@ | |||
| { | ||||
|   lib, | ||||
|   inputs, | ||||
|   config, | ||||
|   ... | ||||
| }: | ||||
| let | ||||
|   ## Recursive loading of libraries, similar to snowfall lib. | ||||
|   ## Logical flow: read files => merge all file outputs to single attr. set | ||||
|   ## The directory in question is flake-root => lib | ||||
|   ## The directory structure is: | ||||
|   ## lib/ | ||||
|   ##   => libname | ||||
|   ##     => default.nix | ||||
|   ##   => libname2 | ||||
|   ##     => default.nix | ||||
|   ## | ||||
|   ## The structure of multiple libs is simply for organization and the attrs. of all default.nix files should still be merged | ||||
|   ## into a single set. | ||||
|   loadLibs = directory: | ||||
|     builtins.foldl' (acc: name: | ||||
|       let | ||||
|         path = "${directory}/${name}"; | ||||
|         isDir = (builtins.getAttr name (builtins.readDir directory)) == "directory"; | ||||
|       in | ||||
|         if isDir then | ||||
|           lib.mergeAttrs acc (loadLibs path) | ||||
|         else if name == "default.nix" then | ||||
|           lib.mergeAttrs acc (import path { inherit lib; }) | ||||
|         else | ||||
|           acc | ||||
|     ) {} (builtins.attrNames (builtins.readDir directory)); | ||||
| in | ||||
| { | ||||
|   # Overwrite and add new arguments to all flake modules. | ||||
|   _module.args = { | ||||
|     namespace = config.flake.namespace; | ||||
| 
 | ||||
|     puzzlelib = loadLibs ../../lib; | ||||
| 
 | ||||
|     # Initialize nixpkgs instance with custom overlays. | ||||
|     pkgs = import inputs.nixpkgs { | ||||
|       overlays = [ | ||||
|  |  | |||
|  | @ -7,6 +7,13 @@ | |||
|     ./hardware.nix | ||||
|   ]; | ||||
| 
 | ||||
|   virtualisation.vmVariant = { | ||||
|     virtualisation = { | ||||
|       cores = 6; | ||||
|       memorySize = 2048; | ||||
|     }; | ||||
|   }; | ||||
| 
 | ||||
|   # Todo: pass a set of users to enable from within easy-hosts and automatically map the corresponding home-manager configurations | ||||
|   # ${namespace} = { | ||||
|   #   mainUser = "jo"; | ||||
|  | @ -18,7 +25,7 @@ | |||
| 
 | ||||
|   # Enable Plasma6 | ||||
|   services.xserver.enable = true; | ||||
|   services.displayManager.sddm.wayland.enable = true; | ||||
|   services.displayManager.sddm.enable = true; | ||||
|   services.desktopManager.plasma6.enable = true; | ||||
| 
 | ||||
|   environment.systemPackages = with pkgs; [ | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue