Add system theme switch script
This commit is contained in:
		
							parent
							
								
									794613626e
								
							
						
					
					
						commit
						9ff684216f
					
				
					 2 changed files with 25 additions and 0 deletions
				
			
		
							
								
								
									
										24
									
								
								system/specialisation.nix
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										24
									
								
								system/specialisation.nix
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,24 @@
 | 
			
		|||
{ pkgs, ... }: {
 | 
			
		||||
  specialisation.dark-theme.configuration = {
 | 
			
		||||
    nixpkgs.overlays = [
 | 
			
		||||
      (final: prev: {
 | 
			
		||||
        uservars = prev.uservars;
 | 
			
		||||
      })
 | 
			
		||||
    ];
 | 
			
		||||
  };
 | 
			
		||||
  specialisation.light-theme.configuration = {
 | 
			
		||||
    nixpkgs.overlays = [
 | 
			
		||||
      (final: prev: {
 | 
			
		||||
        uservars = prev.uservars // rec {
 | 
			
		||||
          theme = prev.uservars.themes.light;
 | 
			
		||||
          color = theme.color;
 | 
			
		||||
        };
 | 
			
		||||
      })
 | 
			
		||||
    ];
 | 
			
		||||
  };
 | 
			
		||||
  environment.systemPackages = [
 | 
			
		||||
    (pkgs.writeShellScriptBin "theme" ''
 | 
			
		||||
      sudo "/nix/var/nix/profiles/system/specialisation/$1-theme/bin/switch-to-configuration" test
 | 
			
		||||
    '')
 | 
			
		||||
  ];
 | 
			
		||||
}
 | 
			
		||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue