| 
									
										
										
										
											2022-12-05 21:32:35 +01:00
										 |  |  | # 3d-printing software | 
					
						
							| 
									
										
										
										
											2023-11-07 22:00:00 +01:00
										 |  |  | { config, lib, ... }: | 
					
						
							| 
									
										
										
										
											2022-12-05 21:32:35 +01:00
										 |  |  | let | 
					
						
							| 
									
										
										
										
											2022-12-05 22:53:25 +01:00
										 |  |  |   cfg = config.my.services.octoprint; | 
					
						
							| 
									
										
										
										
											2022-12-05 21:32:35 +01:00
										 |  |  | in | 
					
						
							|  |  |  | { | 
					
						
							| 
									
										
										
										
											2023-11-26 16:21:07 +01:00
										 |  |  |   options.my.services.octoprint = { | 
					
						
							|  |  |  |     enable = lib.mkEnableOption "Octoprint Server"; | 
					
						
							| 
									
										
										
										
											2022-12-05 21:32:35 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-11-26 16:21:07 +01:00
										 |  |  |     plugins = lib.mkOption { | 
					
						
							|  |  |  |       type = lib.types.listOf lib.types.package; | 
					
						
							| 
									
										
										
										
											2023-11-07 22:00:00 +01:00
										 |  |  |       default = [ ]; | 
					
						
							| 
									
										
										
										
											2023-11-26 16:21:07 +01:00
										 |  |  |       defaultText = lib.literalExpression "plugins: []"; | 
					
						
							|  |  |  |       example = lib.literalExpression "plugins: with plugins; [ themeify stlviewer ]"; | 
					
						
							| 
									
										
										
										
											2022-12-05 21:32:35 +01:00
										 |  |  |       description = lib.mdDoc "Additional plugins to be used. Available plugins are passed through the plugins input."; | 
					
						
							|  |  |  |     }; | 
					
						
							|  |  |  |   }; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   config = lib.mkIf cfg.enable { | 
					
						
							|  |  |  |     services.octoprint = { | 
					
						
							|  |  |  |       enable = true; | 
					
						
							| 
									
										
										
										
											2024-07-28 21:08:02 +02:00
										 |  |  |       plugins = | 
					
						
							|  |  |  |         plugins: | 
					
						
							|  |  |  |         with plugins; | 
					
						
							|  |  |  |         [ | 
					
						
							|  |  |  |           costestimation | 
					
						
							|  |  |  |           displayprogress | 
					
						
							|  |  |  |           m86motorsoff | 
					
						
							|  |  |  |           stlviewer | 
					
						
							|  |  |  |           telegram | 
					
						
							|  |  |  |           titlestatus | 
					
						
							|  |  |  |         ] | 
					
						
							|  |  |  |         ++ cfg.plugins; | 
					
						
							| 
									
										
										
										
											2022-12-05 21:32:35 +01:00
										 |  |  |     }; | 
					
						
							|  |  |  |     networking.firewall.allowedTCPPorts = [ 5000 ]; | 
					
						
							|  |  |  |   }; | 
					
						
							|  |  |  | } |