| 
									
										
										
										
											2022-12-05 21:32:35 +01:00
										 |  |  | # 3d-printing software | 
					
						
							|  |  |  | { config, lib, pkgs, ... }: | 
					
						
							|  |  |  | let | 
					
						
							| 
									
										
										
										
											2022-12-05 22:53:25 +01:00
										 |  |  |   cfg = config.my.services.octoprint; | 
					
						
							| 
									
										
										
										
											2022-12-05 21:32:35 +01:00
										 |  |  | in | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |   options.my.services.octoprint = with lib; { | 
					
						
							|  |  |  |     enable = mkEnableOption "Octoprint Server"; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     plugins = mkOption { | 
					
						
							|  |  |  |       type = types.functionTo (types.listOf types.package); | 
					
						
							|  |  |  |       default = plugins: [ ]; | 
					
						
							|  |  |  |       defaultText = literalExpression "plugins: []"; | 
					
						
							|  |  |  |       example = literalExpression "plugins: with plugins; [ themeify stlviewer ]"; | 
					
						
							|  |  |  |       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; | 
					
						
							|  |  |  |       plugins = plugins: with plugins; [ | 
					
						
							|  |  |  |         costestimation | 
					
						
							|  |  |  |         displayprogress | 
					
						
							|  |  |  |         m86motorsoff | 
					
						
							|  |  |  |         stlviewer | 
					
						
							|  |  |  |         telegram | 
					
						
							|  |  |  |         titlestatus | 
					
						
							| 
									
										
										
										
											2022-12-05 22:53:25 +01:00
										 |  |  |       ] ++ cfg.plugins; | 
					
						
							| 
									
										
										
										
											2022-12-05 21:32:35 +01:00
										 |  |  |     }; | 
					
						
							|  |  |  |     networking.firewall.allowedTCPPorts = [ 5000 ]; | 
					
						
							|  |  |  |   }; | 
					
						
							|  |  |  | } |