nixos: initial bitmap font support
This commit is contained in:
		
							parent
							
								
									3cb560dfe1
								
							
						
					
					
						commit
						3f11846977
					
				
					 10 changed files with 118 additions and 22 deletions
				
			
		|  | @ -18,7 +18,7 @@ | ||||||
|     }; |     }; | ||||||
|     workstation = { |     workstation = { | ||||||
|       environment = "hyprland"; |       environment = "hyprland"; | ||||||
|       theme = "minimal"; |       theme = "hozen"; | ||||||
|       profiles = ["creative" "virtualization" "gaming" "media" "communication" "productivity"]; |       profiles = ["creative" "virtualization" "gaming" "media" "communication" "productivity"]; | ||||||
|       default = { |       default = { | ||||||
|         browser = "firefox"; |         browser = "firefox"; | ||||||
|  |  | ||||||
|  | @ -51,9 +51,9 @@ in { | ||||||
|         elixir.symbol = " "; |         elixir.symbol = " "; | ||||||
|         elm.symbol = " "; |         elm.symbol = " "; | ||||||
|         gcloud.symbol = " "; |         gcloud.symbol = " "; | ||||||
|         git_branch.symbol = " "; |         git_branch.symbol = ""; | ||||||
|         golang.symbol = " "; |         golang.symbol = " "; | ||||||
|         hg_branch.symbol = " "; |         hg_branch.symbol = ""; | ||||||
|         java.symbol = " "; |         java.symbol = " "; | ||||||
|         julia.symbol = " "; |         julia.symbol = " "; | ||||||
|         memory_usage.symbol = " "; |         memory_usage.symbol = " "; | ||||||
|  |  | ||||||
|  | @ -13,5 +13,7 @@ in { | ||||||
|     pkgs.noto-fonts |     pkgs.noto-fonts | ||||||
|     pkgs.noto-fonts-cjk-sans |     pkgs.noto-fonts-cjk-sans | ||||||
|     pkgs.noto-fonts-emoji |     pkgs.noto-fonts-emoji | ||||||
|  |     (pkgs.nerdfonts.override | ||||||
|  |       {fonts = ["NerdFontsSymbolsOnly"];}) | ||||||
|   ]; |   ]; | ||||||
| } | } | ||||||
|  |  | ||||||
|  | @ -23,13 +23,13 @@ in { | ||||||
|       settings.mainBar = { |       settings.mainBar = { | ||||||
|         layer = "top"; |         layer = "top"; | ||||||
|         position = "top"; |         position = "top"; | ||||||
|         height = 30; |         height = 32; | ||||||
|         width = monitorWidth; |         width = monitorWidth; | ||||||
|         exclusive = true; |         exclusive = true; | ||||||
|         margin-top = 10; |         margin-top = 10; | ||||||
|         margin-bottom = -12; |         margin-bottom = -12; | ||||||
| 
 | 
 | ||||||
|         modules-left = ["clock" "battery" "hyprland/workspaces"]; |         modules-left = ["custom/logo" "clock" "battery" "hyprland/workspaces"]; | ||||||
|         modules-center = []; |         modules-center = []; | ||||||
|         modules-right = ["custom/hyprrecord" "tray"]; |         modules-right = ["custom/hyprrecord" "tray"]; | ||||||
| 
 | 
 | ||||||
|  | @ -82,6 +82,11 @@ in { | ||||||
|           on-click = "exec hyprrecord -a --waybar screen copysave video"; |           on-click = "exec hyprrecord -a --waybar screen copysave video"; | ||||||
|           signal = 12; |           signal = 12; | ||||||
|         }; |         }; | ||||||
|  |         "custom/logo" = { | ||||||
|  |           format = "    "; | ||||||
|  |           tooltop = "false"; | ||||||
|  |           on-click = "exec notify-send 'hello!'"; | ||||||
|  |         }; | ||||||
|       }; |       }; | ||||||
|       style = |       style = | ||||||
|         /* |         /* | ||||||
|  | @ -89,8 +94,8 @@ in { | ||||||
|         */ |         */ | ||||||
|         '' |         '' | ||||||
|           * { |           * { | ||||||
|             font-family: "${fonts.monospace.family}"; |             font-family: "${fonts.monospace.family}:style=Medium"; | ||||||
|             font-size: 19px; |             font-size: ${toString fonts.monospace.size}px; | ||||||
|             border: solid #${color.border.base}; |             border: solid #${color.border.base}; | ||||||
|           } |           } | ||||||
| 
 | 
 | ||||||
|  | @ -153,6 +158,13 @@ in { | ||||||
|             color: #${color.orange.base}; |             color: #${color.orange.base}; | ||||||
|           } |           } | ||||||
| 
 | 
 | ||||||
|  |           #custom-logo { | ||||||
|  |             background-image: url('/home/ooks/Media/Pictures/my-art/pixel-art/info-icon.svg'); | ||||||
|  |             background-position: center; | ||||||
|  |             background-repeat: no-repeat; | ||||||
|  |             background-size: 24px; | ||||||
|  |           } | ||||||
|  | 
 | ||||||
|           #custom-hyprrecord { |           #custom-hyprrecord { | ||||||
|             color: #${color.red.base}; |             color: #${color.red.base}; | ||||||
|             padding-right: 20px; |             padding-right: 20px; | ||||||
|  |  | ||||||
|  | @ -1,22 +1,24 @@ | ||||||
| { | { | ||||||
|   osConfig, |   osConfig, | ||||||
|   hozen, |   hozen, | ||||||
|  |   inputs', | ||||||
|   ... |   ... | ||||||
| }: let | }: let | ||||||
|   inherit (osConfig.ooknet.appearance) cursor; |   inherit (osConfig.ooknet.appearance) cursor; | ||||||
|   inherit (hozen) color; |   inherit (hozen) color; | ||||||
| in { | in { | ||||||
|   wayland.windowManager.hyprland = { |   wayland.windowManager.hyprland = { | ||||||
|  |     plugins = [inputs'.hyprland-plugins.packages.borders-plus-plus]; | ||||||
|     settings = { |     settings = { | ||||||
|       # cursor = { |       # cursor = { | ||||||
|       #   inactive_timeout = 4; |       #   inactive_timeout = 4; | ||||||
|       # }; |       # }; | ||||||
|       general = { |       general = { | ||||||
|  |         border_size = 2; | ||||||
|  |         "col.inactive_border" = "rgb(${color.neutrals."700"})"; | ||||||
|  |         "col.active_border" = "rgb(${color.neutrals."650"})"; | ||||||
|         gaps_in = 10; |         gaps_in = 10; | ||||||
|         gaps_out = 10; |         gaps_out = 10; | ||||||
|         border_size = 2; |  | ||||||
|         "col.active_border" = "0xff${color.border.active}"; |  | ||||||
|         "col.inactive_border" = "0xff${color.border.inactive}"; |  | ||||||
|       }; |       }; | ||||||
| 
 | 
 | ||||||
|       exec-once = [ |       exec-once = [ | ||||||
|  | @ -35,12 +37,23 @@ in { | ||||||
|           ignore_opacity = true; |           ignore_opacity = true; | ||||||
|         }; |         }; | ||||||
|         shadow = { |         shadow = { | ||||||
|           range = 12; |           enabled = true; | ||||||
|           offset = "3 3"; |           range = 2; | ||||||
|           color = "0x44000000"; |           sharp = true; | ||||||
|           color_inactive = "0x66000000"; |           offset = "2 2"; | ||||||
|  |           color = "0xff${color.neutrals."850"}"; | ||||||
|  |           color_inactive = "0xff${color.neutrals."850"}"; | ||||||
|         }; |         }; | ||||||
|       }; |       }; | ||||||
|  |       "plugin:borders-plus-plus" = { | ||||||
|  |         enabled = true; | ||||||
|  |         add_borders = 1; | ||||||
|  |         "col.border_1" = "rgb(${color.neutrals."600"})"; | ||||||
|  | 
 | ||||||
|  |         border_size_1 = 2; | ||||||
|  |         border_size_2 = 2; | ||||||
|  |         natural_rounding = false; | ||||||
|  |       }; | ||||||
|       animations = { |       animations = { | ||||||
|         enabled = false; |         enabled = false; | ||||||
|       }; |       }; | ||||||
|  |  | ||||||
|  | @ -9,6 +9,10 @@ | ||||||
|   inherit (lib) mkMerge mkIf; |   inherit (lib) mkMerge mkIf; | ||||||
|   inherit (osConfig.ooknet.workstation) default; |   inherit (osConfig.ooknet.workstation) default; | ||||||
|   cfg = osConfig.ooknet.workstation.programs.foot; |   cfg = osConfig.ooknet.workstation.programs.foot; | ||||||
|  |   fontOptions = let | ||||||
|  |     size = if fonts.monospace.bitmap then "pixelsize" else "size"; | ||||||
|  |     family = if fonts.monospace.bitmap then "${fonts.monospace.family}:style=Medium" else "${fonts.monospace.family}"; | ||||||
|  |   in "${family}:${size}${toString fonts.monospace.size}"; | ||||||
| in { | in { | ||||||
|   config = mkMerge [ |   config = mkMerge [ | ||||||
|     (mkIf (cfg.enable || default.terminal == "foot") { |     (mkIf (cfg.enable || default.terminal == "foot") { | ||||||
|  | @ -18,12 +22,12 @@ in { | ||||||
|         settings = { |         settings = { | ||||||
|           main = { |           main = { | ||||||
|             term = "xterm-256color"; |             term = "xterm-256color"; | ||||||
|             font = "${fonts.monospace.family}:pixelsize=18:antialias=true"; |             font = "${fonts.monospace.family}:style=Medium:pixelsize=${toString fonts.monospace.size}",${fonts.monospace.fallback.family}; | ||||||
|             font-bold = "${fonts.monospace.family}:style=Bold:pixelsize=18:antialias=true"; |             font-bold = "${fonts.monospace.family}:style=Medium:pixelsize=${toString fonts.monospace.size}"; | ||||||
|             font-italic = "${fonts.monospace.family}:style=Italic:pixelsize=18:antialias=true"; |             font-italic = "${fonts.monospace.family}:style=Medium:pixelsize=${toString fonts.monospace.size}"; | ||||||
|             font-bold-italic = "${fonts.monospace.family}:style=Bold Italic:pixelsize=18:antialias=true"; |             font-bold-italic = "${fonts.monospace.family}:style=Medium:pixelsize=${toString fonts.monospace.size}"; | ||||||
|             dpi-aware = "yes"; |             dpi-aware = "no"; | ||||||
|             letter-spacing = "-1px"; |             letter-spacing = "0"; | ||||||
|             bold-text-in-bright = "palette-based"; |             bold-text-in-bright = "palette-based"; | ||||||
|             resize-delay-ms = "80"; |             resize-delay-ms = "80"; | ||||||
|             pad = "9x9 center"; |             pad = "9x9 center"; | ||||||
|  |  | ||||||
|  | @ -1,6 +1,6 @@ | ||||||
| {lib, ...}: let | {lib, ...}: let | ||||||
|   inherit (lib) mkOption; |   inherit (lib) mkOption; | ||||||
|   inherit (lib.types) str package path int; |   inherit (lib.types) str package path int bool; | ||||||
| 
 | 
 | ||||||
|   mkFontOption = { |   mkFontOption = { | ||||||
|     family = mkOption { |     family = mkOption { | ||||||
|  | @ -11,6 +11,28 @@ | ||||||
|       type = package; |       type = package; | ||||||
|       default = null; |       default = null; | ||||||
|     }; |     }; | ||||||
|  |     size = mkOption { | ||||||
|  |       type = int; | ||||||
|  |       default = 18; | ||||||
|  |     }; | ||||||
|  |     bitmap = mkOption { | ||||||
|  |       type = bool; | ||||||
|  |       default = false; | ||||||
|  |     }; | ||||||
|  |     fallback = { | ||||||
|  |       family = mkOption { | ||||||
|  |         type = str; | ||||||
|  |         default = ""; | ||||||
|  |       }; | ||||||
|  |       package = mkOption { | ||||||
|  |         type = package; | ||||||
|  |         default = null; | ||||||
|  |       }; | ||||||
|  |       size = mkOption { | ||||||
|  |         type = int; | ||||||
|  |         default = null; | ||||||
|  |       }; | ||||||
|  |     }; | ||||||
|   }; |   }; | ||||||
| in { | in { | ||||||
|   #  imports = [./palettes]; |   #  imports = [./palettes]; | ||||||
|  |  | ||||||
|  | @ -4,7 +4,7 @@ | ||||||
| in { | in { | ||||||
|   options.ooknet.workstation = { |   options.ooknet.workstation = { | ||||||
|     theme = mkOption { |     theme = mkOption { | ||||||
|       type = nullOr (enum ["minimal"]); |       type = nullOr (enum ["minimal" "hozen"]); | ||||||
|       default = null; |       default = null; | ||||||
|     }; |     }; | ||||||
|     profiles = mkOption { |     profiles = mkOption { | ||||||
|  |  | ||||||
|  | @ -1,5 +1,6 @@ | ||||||
| { | { | ||||||
|   imports = [ |   imports = [ | ||||||
|     ./minimal.nix |     ./minimal.nix | ||||||
|  |     ./hozen.nix | ||||||
|   ]; |   ]; | ||||||
| } | } | ||||||
|  |  | ||||||
							
								
								
									
										42
									
								
								modules/nixos/workstation/themes/hozen.nix
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										42
									
								
								modules/nixos/workstation/themes/hozen.nix
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,42 @@ | ||||||
|  | { | ||||||
|  |   config, | ||||||
|  |   lib, | ||||||
|  |   pkgs, | ||||||
|  |   hozen, | ||||||
|  |   ... | ||||||
|  | }: let | ||||||
|  |   inherit (lib) mkIf; | ||||||
|  |   inherit (config.ooknet.workstation) theme; | ||||||
|  |   generatedWallpaper = import ./generated-wallpaper.nix {inherit hozen config pkgs;} {}; | ||||||
|  | in { | ||||||
|  |   config = mkIf (theme == "hozen") { | ||||||
|  |     ooknet.appearance = { | ||||||
|  |       fonts = { | ||||||
|  |         monospace = { | ||||||
|  |           family = "CozetteHiDpi"; | ||||||
|  |           package = pkgs.cozette; | ||||||
|  |           size = 22; | ||||||
|  |           fallback = { | ||||||
|  |             family = "JetBrainsMono Nerd Font"; | ||||||
|  |             package = pkgs.nerfonts.override {fonts = ["JetBrainsMono"];}; | ||||||
|  |             size = 18; | ||||||
|  |           }; | ||||||
|  |         }; | ||||||
|  |         regular = { | ||||||
|  |           family = "Fira Sans"; | ||||||
|  |           package = pkgs.fira; | ||||||
|  |         }; | ||||||
|  |       }; | ||||||
|  | 
 | ||||||
|  |       cursor = { | ||||||
|  |         name = "Bibata-Modern-Ice"; | ||||||
|  |         package = pkgs.bibata-cursors; | ||||||
|  |         size = 22; | ||||||
|  |       }; | ||||||
|  | 
 | ||||||
|  |       wallpaper = { | ||||||
|  |         path = "${generatedWallpaper}"; | ||||||
|  |       }; | ||||||
|  |     }; | ||||||
|  |   }; | ||||||
|  | } | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue