| 
									
										
										
										
											2014-04-14 16:26:48 +02:00
										 |  |  | { config, lib, pkgs, ... }: | 
					
						
							| 
									
										
										
										
											2008-05-08 13:47:44 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2014-04-14 16:26:48 +02:00
										 |  |  | with lib; | 
					
						
							| 
									
										
										
										
											2009-10-12 16:36:19 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2008-05-08 13:47:44 +00:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2012-10-05 13:44:15 -04:00
										 |  |  |   ###### interface | 
					
						
							| 
									
										
										
										
											2008-05-08 13:47:44 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-10-05 13:44:15 -04:00
										 |  |  |   options = { | 
					
						
							| 
									
										
										
										
											2009-10-12 16:36:19 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-10-05 13:44:15 -04:00
										 |  |  |     services.klogd.enable = mkOption { | 
					
						
							|  |  |  |       type = types.bool; | 
					
						
							|  |  |  |       default = versionOlder (getVersion config.boot.kernelPackages.kernel) "3.5"; | 
					
						
							|  |  |  |       description = ''
 | 
					
						
							|  |  |  |         Whether to enable klogd, the kernel log message processing | 
					
						
							|  |  |  |         daemon.  Since systemd handles logging of kernel messages on | 
					
						
							|  |  |  |         Linux 3.5 and later, this is only useful if you're running an | 
					
						
							|  |  |  |         older kernel. | 
					
						
							|  |  |  |       '';
 | 
					
						
							|  |  |  |     }; | 
					
						
							| 
									
										
										
										
											2009-10-12 16:36:19 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-10-05 13:44:15 -04:00
										 |  |  |   }; | 
					
						
							| 
									
										
										
										
											2011-11-25 16:32:54 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-10-05 13:44:15 -04:00
										 |  |  | 
 | 
					
						
							|  |  |  |   ###### implementation | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   config = mkIf config.services.klogd.enable { | 
					
						
							| 
									
										
										
										
											2016-01-06 06:50:18 +00:00
										 |  |  |     systemd.services.klogd = { | 
					
						
							|  |  |  |       description = "Kernel Log Daemon"; | 
					
						
							|  |  |  |       wantedBy = [ "multi-user.target" ]; | 
					
						
							|  |  |  |       path = [ pkgs.sysklogd ]; | 
					
						
							|  |  |  |       unitConfig.ConditionVirtualization = "!systemd-nspawn"; | 
					
						
							|  |  |  |       script = | 
					
						
							|  |  |  |         "klogd -c 1 -2 -n " + | 
					
						
							|  |  |  |         "-k $(dirname $(readlink -f /run/booted-system/kernel))/System.map"; | 
					
						
							|  |  |  |     }; | 
					
						
							| 
									
										
										
										
											2012-10-05 13:44:15 -04:00
										 |  |  |   }; | 
					
						
							| 
									
										
										
										
											2008-05-08 13:47:44 +00:00
										 |  |  | } |