From 65e48c07c999a17d07ad6f09262f9191f3fba9e0 Mon Sep 17 00:00:00 2001 From: mat ess Date: Sun, 20 Nov 2022 17:25:59 -0500 Subject: [PATCH] =?UTF-8?q?Use=20Ros=C3=A9=20Pine?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- flake.nix | 4 +++- home/kitty.nix | 11 ++++++++--- home/programs.nix | 4 ++-- modules/home/programs/kitty/extras.nix | 26 ++++++++++++++++++++++---- 4 files changed, 35 insertions(+), 10 deletions(-) diff --git a/flake.nix b/flake.nix index 7c6747c..3ccef85 100644 --- a/flake.nix +++ b/flake.nix @@ -38,6 +38,8 @@ dark-mode-notify-src.flake = false; kitty-icon.url = "github:DinkDonk/kitty-icon"; kitty-icon.flake = false; + kitty-rose-pine.url = "github:rose-pine/kitty"; + kitty-rose-pine.flake = false; fisher-src.url = "github:jorgebucaran/fisher"; fisher-src.flake = false; }; @@ -256,7 +258,7 @@ }; patched = _final: prev: optionalAttrs prev.stdenv.isDarwin { - inherit (inputs) kitty-icon fisher-src; + inherit (inputs) kitty-icon kitty-rose-pine fisher-src; lib = prev.lib // { homebrew-enabled = inputs.homebrew-enabled.value; }; }; }; diff --git a/home/kitty.nix b/home/kitty.nix index 82e3ccf..e89b97b 100644 --- a/home/kitty.nix +++ b/home/kitty.nix @@ -72,9 +72,14 @@ in # }}} # Colors config ------------------------------------------------------------------------------ {{{ - programs.kitty.extras.colors.enable = true; - programs.kitty.extras.colors.dark = colorsToKitty pkgs.lib.colors.tokyonight.dark; - programs.kitty.extras.colors.light = colorsToKitty pkgs.lib.colors.tokyonight.light; + programs.kitty.extras.colors = { + enable = true; + dark = colorsToKitty pkgs.lib.colors.tokyonight.dark; + light = colorsToKitty pkgs.lib.colors.tokyonight.light; + color-pkg = pkgs.kitty-rose-pine; + dark-name = "dist/rose-pine"; + light-name = "dist/rose-pine-dawn"; + }; programs.fish.functions.set-term-colors = { body = '' diff --git a/home/programs.nix b/home/programs.nix index 2b4156f..53a679e 100644 --- a/home/programs.nix +++ b/home/programs.nix @@ -19,7 +19,7 @@ in style = "auto"; }; }; - # See `./shells.nix` for more on how this is used. + # See `./fish.nix` for more on how this is used. fish = { functions = { set-bat-colors = { @@ -49,7 +49,7 @@ in enable = true; package = pkgs.helix-flake; settings = { - theme = "base16_transparent"; + theme = "rose_pine"; editor.indent-guides.render = true; }; }; diff --git a/modules/home/programs/kitty/extras.nix b/modules/home/programs/kitty/extras.nix index 7ca8d10..e2f5f4d 100644 --- a/modules/home/programs/kitty/extras.nix +++ b/modules/home/programs/kitty/extras.nix @@ -23,18 +23,18 @@ let # Shell scripts for changing Kitty colors term-background = pkgs.writeShellScriptBin "term-background" '' - # Accepts arguments "light" or "dark". + # Accepts the name of a theme file in color-pkg # If shell is running in a Kitty window set the colors. if [ -n "$KITTY_WINDOW_ID" ]; then kitty @ --to $KITTY_LISTEN_ON set-colors --all --configured \ - ${kitty-colors}/"$1".conf & + ${cfg.colors.color-pkg}/"$1".conf & fi ''; term-light = pkgs.writeShellScriptBin "term-light" '' - ${term-background}/bin/term-background light + ${term-background}/bin/term-background ${cfg.colors.light-name} ''; term-dark = pkgs.writeShellScriptBin "term-dark" '' - ${term-background}/bin/term-background dark + ${term-background}/bin/term-background ${cfg.colors.dark-name} ''; in { @@ -67,6 +67,24 @@ in Kitty color settings for light background colorscheme. ''; }; + + color-pkg = mkOption { + type = types.package; + default = kitty-colors; + description = "Package from which to load kitty colors."; + }; + + light-name = mkOption { + type = types.str; + default = "light"; + description = "The name to use for the light colorscheme."; + }; + + dark-name = mkOption { + type = types.str; + default = "dark"; + description = "The name to use for the dark colorscheme."; + }; }; useSymbolsFromNerdFont = mkOption {