mirror of
				https://github.com/nmasur/dotfiles
				synced 2025-11-04 12:53:15 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			36 lines
		
	
	
		
			680 B
		
	
	
	
		
			Nix
		
	
	
	
	
	
			
		
		
	
	
			36 lines
		
	
	
		
			680 B
		
	
	
	
		
			Nix
		
	
	
	
	
	
{
 | 
						|
  config,
 | 
						|
  lib,
 | 
						|
  ...
 | 
						|
}:
 | 
						|
 | 
						|
let
 | 
						|
  cfg = config.nmasur.presets.services.redshift;
 | 
						|
in
 | 
						|
 | 
						|
{
 | 
						|
 | 
						|
  options.nmasur.presets.services.redshift.enable = lib.mkEnableOption "Redshift light adjuster";
 | 
						|
 | 
						|
  config = lib.mkIf cfg.enable {
 | 
						|
 | 
						|
    # Reduce blue light at night
 | 
						|
    services.redshift = {
 | 
						|
      enable = true;
 | 
						|
      brightness = {
 | 
						|
        day = "1.0";
 | 
						|
        night = "1.0";
 | 
						|
      };
 | 
						|
    };
 | 
						|
 | 
						|
    # Service to determine location for time zone
 | 
						|
    # This is required for redshift which depends on the location provider
 | 
						|
    services.geoclue2.enable = true;
 | 
						|
    services.geoclue2.enableWifi = false; # Breaks when it can't connect
 | 
						|
    location = {
 | 
						|
      provider = "geoclue2";
 | 
						|
    };
 | 
						|
 | 
						|
  };
 | 
						|
}
 |