forked from jan-leila/nix-config
		
	feat: added night light as a dconf option
This commit is contained in:
		
							parent
							
								
									c81fa77a29
								
							
						
					
					
						commit
						ee6d48fe49
					
				
					 3 changed files with 56 additions and 0 deletions
				
			
		|  | @ -81,6 +81,36 @@ in { | |||
|       description = "GNOME experimental features to enable"; | ||||
|     }; | ||||
| 
 | ||||
|     nightLight = lib.mkOption { | ||||
|       type = lib.types.submodule { | ||||
|         options = { | ||||
|           enable = lib.mkEnableOption "night light (blue light filter)"; | ||||
|           automatic = lib.mkOption { | ||||
|             type = lib.types.bool; | ||||
|             default = true; | ||||
|             description = "Whether to automatically schedule night light based on sunset/sunrise"; | ||||
|           }; | ||||
|           fromTime = lib.mkOption { | ||||
|             type = lib.types.float; | ||||
|             default = 20.0; | ||||
|             description = "Start time for night light in 24-hour format (e.g., 20.0 for 8:00 PM)"; | ||||
|           }; | ||||
|           toTime = lib.mkOption { | ||||
|             type = lib.types.float; | ||||
|             default = 6.0; | ||||
|             description = "End time for night light in 24-hour format (e.g., 6.0 for 6:00 AM)"; | ||||
|           }; | ||||
|           temperature = lib.mkOption { | ||||
|             type = lib.types.int; | ||||
|             default = 4000; | ||||
|             description = "Color temperature for night light (1000-10000K, lower is warmer)"; | ||||
|           }; | ||||
|         }; | ||||
|       }; | ||||
|       default = {}; | ||||
|       description = "Night light configuration"; | ||||
|     }; | ||||
| 
 | ||||
|     extensions = { | ||||
|       dash-to-dock = { | ||||
|         enable = lib.mkEnableOption "Dash to Dock extension"; | ||||
|  | @ -123,6 +153,17 @@ in { | |||
|             lib.optional config.gnome.experimentalFeatures.scaleMonitorFramebuffer "scale-monitor-framebuffer" | ||||
|           ); | ||||
|         } | ||||
| 
 | ||||
|         # Night light configuration | ||||
|         (lib.mkIf config.gnome.nightLight.enable { | ||||
|           "org/gnome/settings-daemon/plugins/color" = { | ||||
|             night-light-enabled = true; | ||||
|             night-light-schedule-automatic = config.gnome.nightLight.automatic; | ||||
|             night-light-schedule-from = lib.mkIf (!config.gnome.nightLight.automatic) config.gnome.nightLight.fromTime; | ||||
|             night-light-schedule-to = lib.mkIf (!config.gnome.nightLight.automatic) config.gnome.nightLight.toTime; | ||||
|             night-light-temperature = config.gnome.nightLight.temperature; | ||||
|           }; | ||||
|         }) | ||||
|         ( | ||||
|           lib.mkMerge ( | ||||
|             builtins.map (value: let | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue