theme: set up stylix (where reasonable)
1 file changed, 55 insertions(+), 52 deletions(-)
changed files
M user/settings/theme.nix → user/settings/theme.nix
@@ -1,29 +1,65 @@ { - config, pkgs, lib, - inputs, ... }: +let + inherit (pkgs.stdenv) isDarwin; + # (hard constants) + ppi = 72; + dpi = 96; + mustFloat = x: x * 1.0; + px-pt = px: (mustFloat px) * ppi / dpi; +in { - nixpkgs.overlays = [ - (final: prev: { - theme-sh = prev.theme-sh.overrideAttrs { - patchPhase = '' - install -Dt custom ${inputs.flexoki}/theme.sh/flexoki-{light,dark} - bin/theme.sh -a custom/* - ''; + # hard to find the right documentation page + # https://nix-community.github.io/stylix/options/platforms/home_manager.html + stylix = { + enable = true; + + # actually refers to tinted-themes (https://github.com/tinted-theming/schemes) + # but only in the base16 variants (TODO update nixpkgs) + base16Scheme = "${pkgs.base16-schemes}/share/themes/atelier-dune-light.yaml"; + + fonts = { + sansSerif = lib.mkIf isDarwin { + name = "SF Pro"; + }; + monospace = { + name = "Berkeley Mono"; + }; + + sizes = { + applications = px-pt 15; + # desktop + # popups + # terminal + }; + }; + + targets = { + fish.enable = false; + fzf.colors.enable = false; + zed = { + inputs.enable = false; + fonts.override = { + sansSerif.name = ".ZedSans"; + }; + }; + nixvim = { + enable = true; + plugin = "mini.base16"; + }; + emacs = { + colors.enable = false; + fonts.override.sizes.terminal = 15; }; - }) - ]; + }; + }; + home.packages = with pkgs; [ theme-sh ]; - - xdg.configFile = { - "fish.themes/flexoki-light".source = "${inputs.flexoki}/fish/flexoki-light.theme"; - "fish.themes/flexoki-dark".source = "${inputs.flexoki}/fish/flexoki-dark.theme"; - }; programs.fzf = { defaultOptions = [@@ -51,55 +87,22 @@ home.sessionVariables = { CLICOLOR = "1"; LSCOLORS = "gxfxcxdxDxegedabagacad"; # for macOS's ls + THEME_LIGHT = "atelier-dune-light"; + THEME_DARK = "atelier-dune"; }; programs.fish = { shellAliases.theme = "theme.sh"; loginShellInit = '' - fish_config theme choose Tomorrow - if test -e $XDG_CONFIG_HOME/.theme_history theme.sh (theme.sh -l | tail -n1) else - theme.sh flexoki-light - end - - function __vivid_update --on-variable VIVID_THEME - set -gx LS_COLORS $(vivid ${ - let - vivid = config.programs.vivid; - in - lib.optionalString (vivid.colorMode != null) "-m ${vivid.colorMode}" - } generate $VIVID_THEME) + theme.sh $THEME_LIGHT end bind \co toggle-light-dark ''; - }; - - programs.vivid.activeTheme = "gruvbox-light"; # TODO add flexoki - - programs.nixvim = { - extraPlugins = [ - (pkgs.vimUtils.buildVimPlugin { - name = "flexoki-neovim"; - src = pkgs.fetchFromGitHub { - owner = "kepano"; - repo = "flexoki-neovim"; - rev = "c3e2251e813d29d885a7cbbe9808a7af234d845d"; - hash = "sha256-TlBP99MBAT/H0Uut1MF8SnIDoeetcdHLKrWal2oO2Ug="; - }; - }) - ]; - extraConfigVim = '' - colorscheme flexoki - highlight Search ctermfg=0 - ''; - - colorschemes = { - melange.enable = true; - }; }; programs.zed-editor = {