{ config, lib, ... }: let palette = config.repo.theme.kanagawa.palette; hex = lib.removePrefix "#"; terminalPalette = palette.terminal; mkPalette = colors: lib.concatStringsSep ";" (map hex colors); in { flake.modules.nixos.limine = { config, lib, ... }: let displayValues = builtins.attrValues (config.facts.machine.displays or { }); primaryDisplays = lib.filter (display: display.primary or false) displayValues; primaryDisplay = if primaryDisplays == [ ] then null else builtins.head primaryDisplays; interfaceResolution = if primaryDisplay != null && primaryDisplay ? width && primaryDisplay ? height then "${toString primaryDisplay.width}x${toString primaryDisplay.height}" else null; in { boot.loader = { efi.canTouchEfiVariables = true; limine = { enable = true; maxGenerations = 10; resolution = "2560x1440"; style = { backdrop = hex palette.secondaryBackground; graphicalTerminal = { background = "00${hex palette.background}"; foreground = hex palette.foreground; brightForeground = hex palette.selectionForeground; brightBackground = hex palette.selectionBackground; palette = mkPalette [ terminalPalette.color0 terminalPalette.color1 terminalPalette.color2 terminalPalette.color3 terminalPalette.color4 terminalPalette.color5 terminalPalette.color6 terminalPalette.color7 ]; brightPalette = mkPalette [ terminalPalette.color8 terminalPalette.color9 terminalPalette.color10 terminalPalette.color11 terminalPalette.color12 terminalPalette.color13 terminalPalette.color14 terminalPalette.color15 ]; font = { scale = "2x2"; spacing = 1; }; margin = 64; marginGradient = 24; }; interface = { branding = config.networking.hostName; brandingColor = hex palette.accents.blue; helpHidden = false; resolution = interfaceResolution; }; }; }; }; }; }