| 
									
										
										
										
											2025-08-05 17:39:54 +01:00
										 |  |  | { | 
					
						
							|  |  |  |   inputs.nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2025-08-05 18:31:43 +01:00
										 |  |  |   outputs = | 
					
						
							|  |  |  |     inputs: | 
					
						
							| 
									
										
										
										
											2025-08-05 17:39:54 +01:00
										 |  |  |     let | 
					
						
							|  |  |  |       system = "x86_64-linux"; | 
					
						
							|  |  |  |       pkgs = import inputs.nixpkgs { inherit system; }; | 
					
						
							|  |  |  |     in | 
					
						
							|  |  |  |     { | 
					
						
							|  |  |  |       devShells.${system}.default = pkgs.mkShell { | 
					
						
							|  |  |  |         packages = with pkgs; [ | 
					
						
							|  |  |  |           (pkgs.writeShellApplication { | 
					
						
							|  |  |  |             name = "serve"; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |             runtimeInputs = with pkgs; [ | 
					
						
							|  |  |  |               simple-http-server | 
					
						
							|  |  |  |               tailwindcss_3 | 
					
						
							|  |  |  |             ]; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |             text = ''
 | 
					
						
							| 
									
										
										
										
											2025-08-05 18:31:43 +01:00
										 |  |  |               set -o monitor | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |               simple-http-server --index --nocache "$@" & | 
					
						
							|  |  |  |               PID_SERVER=$! | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |               tailwindcss --input input.css \ | 
					
						
							|  |  |  |                 --output tailwind.css \ | 
					
						
							|  |  |  |                 --watch & | 
					
						
							|  |  |  |               PID_TAILWIND=$! | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |               cleanup() { | 
					
						
							|  |  |  |                 echo "Stopping processes..." | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |                 kill "$PID_SERVER" "$PID_TAILWIND" 2>/dev/null || true | 
					
						
							|  |  |  |                 wait "$PID_SERVER" "$PID_TAILWIND" 2>/dev/null || true | 
					
						
							|  |  |  |               } | 
					
						
							|  |  |  |               trap cleanup EXIT | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2025-08-05 17:39:54 +01:00
										 |  |  |               wait | 
					
						
							|  |  |  |             '';
 | 
					
						
							|  |  |  |           }) | 
					
						
							|  |  |  |         ]; | 
					
						
							|  |  |  |       }; | 
					
						
							|  |  |  |     }; | 
					
						
							|  |  |  | } |