theme: init module
7 files changed, 196 insertions(+), 51 deletions(-)
M flake.lock → flake.lock
@@ -242,6 +242,22 @@ "repo": "flake-utils", "type": "github" } }, + "flexoki": { + "flake": false, + "locked": { + "lastModified": 1764452632, + "narHash": "sha256-jZwqKtBoDqlCTf+FysHRw5oKkalKi0vjnq4dwsyju4Y=", + "owner": "kepano", + "repo": "flexoki", + "rev": "cae1fc41163cc94ad22f6399168f95c2a66ccdef", + "type": "github" + }, + "original": { + "owner": "kepano", + "repo": "flexoki", + "type": "github" + } + }, "gitignore": { "inputs": { "nixpkgs": [@@ -690,6 +706,7 @@ "agenix": "agenix", "angrr": "angrr", "darwin": "darwin", "elgit": "elgit", + "flexoki": "flexoki", "home-manager": "home-manager", "mycal": "mycal", "nix-rosetta-builder": "nix-rosetta-builder",
M flake.nix → flake.nix
@@ -47,6 +47,11 @@ darwin.follows = "darwin"; home-manager.follows = "home-manager"; }; }; + + flexoki = { + url = "github:kepano/flexoki"; + flake = false; + }; }; nixConfig = {@@ -87,6 +92,10 @@ (self: super: { personal = import ./packages/overlay.nix self super; }) ]; + }; + + extraSpecialArgs = { + inherit inputs; }; modules = [
M user/settings/base.nix → user/settings/base.nix
@@ -7,6 +7,7 @@ { imports = [ ./neovim.nix ./shell.nix + ./theme.nix ]; # Let Home Manager install and manage itself.
M user/settings/emacs/init.el → user/settings/emacs/init.el
@@ -70,56 +70,6 @@ ;; Don't ring the bell (setq ring-bell-function #'ignore) -(use-package doom-themes - :if (or (daemonp) - window-system) - :config (progn - (doom-themes-org-config))) - -(let ((light-mode-theme 'doom-one-light) - (dark-mode-theme 'doom-one)) - (load-theme light-mode-theme :noconfirm :noenable) - (load-theme dark-mode-theme :noconfirm :noenable) - - (defun my/switch-theme-variant (mode) - (interactive (list - (intern (completing-read "Make it: " '("light" "dark") nil t)))) - (cond - ((eq mode 'dark) - (disable-theme light-mode-theme) - (enable-theme dark-mode-theme)) - ((eq mode 'light) - (disable-theme dark-mode-theme) - (enable-theme light-mode-theme))) - (modify-all-frames-parameters '((ns-appearance mode)))) - - (defun my/system-appearance () - (if (and (eq system-type 'darwin) - (string-equal - "Dark" - (string-trim-right (shell-command-to-string "defaults read -g AppleInterfaceStyle")))) - 'dark - 'light)) - - (defun my/match-theme-system-appearance () - (interactive) - (my/switch-theme-variant (my/system-appearance))) - - (my/switch-theme-variant (my/system-appearance)) - - (use-package kqueue - :if (eq window-system 'ns) - :config (progn - (defun my/gp-notify-callback (event) - (let* ((filename (elt event 2)) - (basename (file-name-nondirectory filename))) - (when (string-equal basename ".GlobalPreferences.plist") - (my/match-theme-system-appearance)))) - (setq my/kq-watcher-global-preferences - (kqueue-add-watch (expand-file-name "~/Library/Preferences/") - '(write) - #'my/gp-notify-callback))))) - (use-package exec-path-from-shell :if (eq system-type 'darwin) :config (progn
M user/settings/fish.nix → user/settings/fish.nix
@@ -80,7 +80,6 @@ }; programs.vivid = { enable = true; - activeTheme = "one-light"; enableFishIntegration = true; }; }
M user/settings/neovim.nix → user/settings/neovim.nix
@@ -47,6 +47,8 @@ keymap.preset = "super-tab"; }; }; + transparent.enable = true; + mini = { enable = true; mockDevIcons = true;
A user/settings/theme.nix
@@ -0,0 +1,167 @@ +{ + pkgs, + inputs, + ... +}: +let + +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/* + ''; + }; + }) + ]; + 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.colors = { + "fg" = "#B7B5AC"; + "bg" = "#FFFCF0"; + "hl" = "#100F0F"; + "fg+" = "#B7B5AC"; + "bg+" = "#F2F0E5"; + "hl+" = "#100F0F"; + "border" = "#AF3029"; + "header" = "#100F0F"; + "gutter" = "#FFFCF0"; + "spinner" = "#3AA99F"; + "info" = "#3AA99F"; + "separator" = "#F2F0E5"; + "pointer" = "#D0A215"; + "marker" = "#D14D41"; + "prompt" = "#D0A215"; + }; + + programs.fish = { + shellAliases.theme = "theme.sh"; + + loginShellInit = '' + if test -e $XDG_CONFIG_HOME/.theme_history + theme.sh (theme.sh -l | tail -n1) + else + theme.sh flexoki-light + end + + # Optional + # Bind C-o to the last theme. + function last_theme + theme.sh (theme.sh -l | tail -n2 | head -n1) + end + + bind \co last_theme + ''; + }; + + 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 = '' + set notermguicolors + colorscheme flexoki-light + highlight Search ctermfg=0 + ''; + + colorschemes = { + melange.enable = true; + }; + }; + + programs.zed-editor = { + extensions = [ "flexoki-themes" ]; + userSettings.theme = { + light = "Flexoki Light"; + dark = "Flexoki Dark"; + }; + }; + + programs.emacs = + let + pname = "flexoki-themes"; + light-mode-theme = "flexoki-themes-light"; + dark-mode-theme = "flexoki-themes-dark"; + config = '' + ;; (flexoki-themes-use-bold-keywords t) + ;; (flexoki-themes-use-bold-builtins t) + ;; (flexoki-themes-use-italic-comments t) + ''; + in + { + extraPackages = epkgs: [ + epkgs.${pname} + ]; + + extraConfig = '' + (use-package ${pname} + :if (or (daemonp) + window-system) + :config (progn ${config})) + + (let ((light-mode-theme '${light-mode-theme}) + (dark-mode-theme '${dark-mode-theme})) + (load-theme light-mode-theme :noconfirm :noenable) + (load-theme dark-mode-theme :noconfirm :noenable) + + (defun my/switch-theme-variant (mode) + (interactive (list + (intern (completing-read "Make it: " '("light" "dark") nil t)))) + (cond + ((eq mode 'dark) + (disable-theme light-mode-theme) + (enable-theme dark-mode-theme)) + ((eq mode 'light) + (disable-theme dark-mode-theme) + (enable-theme light-mode-theme))) + (modify-all-frames-parameters `((ns-appearance ,mode)))) + + (defun my/system-appearance () + (if (and (eq system-type 'darwin) + (string-equal + "Dark" + (string-trim-right (shell-command-to-string "defaults read -g AppleInterfaceStyle")))) + 'dark + 'light)) + + (defun my/match-theme-system-appearance () + (interactive) + (my/switch-theme-variant (my/system-appearance))) + + (my/switch-theme-variant (my/system-appearance)) + + (use-package kqueue + :if (eq window-system 'ns) + :config (progn + (defun my/gp-notify-callback (event) + (let* ((filename (elt event 2)) + (basename (file-name-nondirectory filename))) + (when (string-equal basename ".GlobalPreferences.plist") + (my/match-theme-system-appearance)))) + (setq my/kq-watcher-global-preferences + (kqueue-add-watch (expand-file-name "~/Library/Preferences/") + '(write) + #'my/gp-notify-callback))))) + ''; + }; +}