Converted gammastep module to home module
This commit is contained in:
		
							parent
							
								
									0862244fd2
								
							
						
					
					
						commit
						9c9667e5ef
					
				
					 5 changed files with 30 additions and 30 deletions
				
			
		| 
						 | 
				
			
			@ -7,7 +7,7 @@
 | 
			
		|||
  namespace,
 | 
			
		||||
  ...
 | 
			
		||||
}: {
 | 
			
		||||
  ${namespace} = {
 | 
			
		||||
  aa = {
 | 
			
		||||
    apps = {
 | 
			
		||||
      bat.enable = true;
 | 
			
		||||
      btop.enable = true;
 | 
			
		||||
| 
						 | 
				
			
			@ -30,6 +30,7 @@
 | 
			
		|||
    };
 | 
			
		||||
 | 
			
		||||
    services = {
 | 
			
		||||
      gammastep.enable = true;
 | 
			
		||||
      playerctld.enable = true;
 | 
			
		||||
      swayidle.enable = true;
 | 
			
		||||
      swaync.enable = true;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
							
								
								
									
										21
									
								
								modules/home/services/gammastep/default.nix
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										21
									
								
								modules/home/services/gammastep/default.nix
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,21 @@
 | 
			
		|||
{
 | 
			
		||||
  config,
 | 
			
		||||
  lib,
 | 
			
		||||
  namespace,
 | 
			
		||||
  ...
 | 
			
		||||
}: let
 | 
			
		||||
  inherit (lib) mkIf mkEnableOption;
 | 
			
		||||
 | 
			
		||||
  cfg = config.${namespace}.services.gammastep;
 | 
			
		||||
in {
 | 
			
		||||
  options.${namespace}.services.gammastep = {
 | 
			
		||||
    enable = mkEnableOption "gammastep";
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  config = mkIf cfg.enable {
 | 
			
		||||
    services.gammastep = {
 | 
			
		||||
      enable = true;
 | 
			
		||||
      provider = "geoclue2";
 | 
			
		||||
    };
 | 
			
		||||
  };
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			@ -1,25 +0,0 @@
 | 
			
		|||
{
 | 
			
		||||
  options,
 | 
			
		||||
  config,
 | 
			
		||||
  lib,
 | 
			
		||||
  pkgs,
 | 
			
		||||
  ...
 | 
			
		||||
}:
 | 
			
		||||
with lib; let
 | 
			
		||||
  cfg = config.aa.desktop.addons.gammastep;
 | 
			
		||||
in {
 | 
			
		||||
  options.aa.desktop.addons.gammastep = with types; {
 | 
			
		||||
    enable = mkEnableOption "gammastep";
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  config = mkIf cfg.enable {
 | 
			
		||||
    services.geoclue2.enable = true;
 | 
			
		||||
 | 
			
		||||
    aa.home.extraOptions = {
 | 
			
		||||
      services.gammastep = {
 | 
			
		||||
        enable = true;
 | 
			
		||||
        provider = "geoclue2";
 | 
			
		||||
      };
 | 
			
		||||
    };
 | 
			
		||||
  };
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			@ -37,7 +37,6 @@ in {
 | 
			
		|||
  config = mkIf cfg.enable {
 | 
			
		||||
    aa.desktop.addons = {
 | 
			
		||||
      alacritty.enable = true;
 | 
			
		||||
      gammastep.enable = true;
 | 
			
		||||
 | 
			
		||||
      # TODO
 | 
			
		||||
      # light
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1,23 +1,27 @@
 | 
			
		|||
{
 | 
			
		||||
  config,
 | 
			
		||||
  lib,
 | 
			
		||||
  namespace,
 | 
			
		||||
  ...
 | 
			
		||||
}: let
 | 
			
		||||
  inherit (lib) mkEnableOption mkIf;
 | 
			
		||||
 | 
			
		||||
  cfg = config.aa.suites.desktop;
 | 
			
		||||
  cfg = config.${namespace}.suites.desktop;
 | 
			
		||||
in {
 | 
			
		||||
  options.aa.suites.desktop = {
 | 
			
		||||
  options.${namespace}.suites.desktop = {
 | 
			
		||||
    enable = mkEnableOption "common desktop configuration";
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  config = mkIf cfg.enable {
 | 
			
		||||
    aa = {
 | 
			
		||||
    ${namespace} = {
 | 
			
		||||
      desktop = {
 | 
			
		||||
        sway.enable = true;
 | 
			
		||||
      };
 | 
			
		||||
    };
 | 
			
		||||
 | 
			
		||||
    # Required to use gammastep home module without providing lat/long
 | 
			
		||||
    services.geoclue2.enable = true;
 | 
			
		||||
 | 
			
		||||
    # The following fixes an issue with using swaylcock as a home module
 | 
			
		||||
    # Workaround for https://github.com/NixOS/nixpkgs/issues/158025
 | 
			
		||||
    # This comment specifically: https://github.com/NixOS/nixpkgs/issues/158025#issuecomment-1344766809
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue