nixos: use hozen colors for generated wallpaper
This commit is contained in:
		
							parent
							
								
									151da369a0
								
							
						
					
					
						commit
						7a4216ae43
					
				
					 2 changed files with 10 additions and 17 deletions
				
			
		|  | @ -2,9 +2,10 @@ | ||||||
| { | { | ||||||
|   pkgs, |   pkgs, | ||||||
|   config, |   config, | ||||||
|  |   hozen, | ||||||
| }: let | }: let | ||||||
|   inherit (config.ooknet.hardware) monitors; |   inherit (config.ooknet.hardware) monitors; | ||||||
|   inherit (config.ooknet.appearance) colorscheme; |   inherit (hozen) color; | ||||||
|   largest = f: xs: builtins.head (builtins.sort (a: b: a > b) (map f xs)); |   largest = f: xs: builtins.head (builtins.sort (a: b: a > b) (map f xs)); | ||||||
|   largestWidth = largest (x: x.width) monitors; |   largestWidth = largest (x: x.width) monitors; | ||||||
|   largestHeight = largest (x: x.height) monitors; |   largestHeight = largest (x: x.height) monitors; | ||||||
|  | @ -13,21 +14,17 @@ in | ||||||
|     width ? largestWidth, |     width ? largestWidth, | ||||||
|     height ? largestHeight, |     height ? largestHeight, | ||||||
|     logoScale ? 4, |     logoScale ? 4, | ||||||
|     backgroundColor ? colorscheme.palette.mantle, |     backgroundColor ? color.layout.body, | ||||||
|     logoColor1 ? colorscheme.palette.yellow, |     logoColor1 ? color.green.base, | ||||||
|     logoColor2 ? colorscheme.palette.green, |     logoColor2 ? color.yellow.base, | ||||||
|   }: |   }: | ||||||
|     pkgs.stdenv.mkDerivation { |     pkgs.stdenv.mkDerivation { | ||||||
|       name = "generated-nix-wallpaper-${colorscheme.slug}.png"; |       name = "generated-nix-wallpaper-${color.slug}.png"; | ||||||
|       src = pkgs.writeTextFile { |       src = pkgs.writeTextFile { | ||||||
|         name = "template.svg"; |         name = "template.svg"; | ||||||
|         text = '' |         text = '' | ||||||
|           <svg width="${toString width}" height="${ |           <svg width="${toString width}" height="${toString height}" version="1.1" xmlns="http://www.w3.org/2000/svg"> | ||||||
|             toString height |              <rect width="${toString width}" height="${toString height}" fill="#${backgroundColor}"/> | ||||||
|           }" version="1.1" xmlns="http://www.w3.org/2000/svg"> |  | ||||||
|              <rect width="${toString width}" height="${ |  | ||||||
|             toString height |  | ||||||
|           }" fill="#${backgroundColor}"/> |  | ||||||
|              <svg x="${toString (width / 2 - (logoScale * 50))}" y="${ |              <svg x="${toString (width / 2 - (logoScale * 50))}" y="${ | ||||||
|             toString (height / 2 - (logoScale * 50)) |             toString (height / 2 - (logoScale * 50)) | ||||||
|           }" version="1.1" xmlns="http://www.w3.org/2000/svg"> |           }" version="1.1" xmlns="http://www.w3.org/2000/svg"> | ||||||
|  |  | ||||||
|  | @ -2,11 +2,12 @@ | ||||||
|   config, |   config, | ||||||
|   lib, |   lib, | ||||||
|   pkgs, |   pkgs, | ||||||
|  |   hozen, | ||||||
|   ... |   ... | ||||||
| }: let | }: let | ||||||
|   inherit (lib) mkIf; |   inherit (lib) mkIf; | ||||||
|   inherit (config.ooknet.workstation) theme; |   inherit (config.ooknet.workstation) theme; | ||||||
|   generatedWallpaper = import ./generated-wallpaper.nix {inherit config pkgs;} {}; |   generatedWallpaper = import ./generated-wallpaper.nix {inherit hozen config pkgs;} {}; | ||||||
| in { | in { | ||||||
|   config = mkIf (theme == "minimal") { |   config = mkIf (theme == "minimal") { | ||||||
|     ooknet.appearance = { |     ooknet.appearance = { | ||||||
|  | @ -30,11 +31,6 @@ in { | ||||||
|       wallpaper = { |       wallpaper = { | ||||||
|         path = "${generatedWallpaper}"; |         path = "${generatedWallpaper}"; | ||||||
|       }; |       }; | ||||||
| 
 |  | ||||||
|       colorscheme = { |  | ||||||
|         name = "gruvbox-material"; |  | ||||||
|         variant = "dark"; |  | ||||||
|       }; |  | ||||||
|     }; |     }; | ||||||
|   }; |   }; | ||||||
| } | } | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue