HASH 1c29de52d326
DATE 2025-01-09
SUBJECT nvf: add custom theme module \
FILES 7 CHANGED
HASH 1c29de52d326
DATE 2025-01-09
SUBJECT nvf: add custom theme module \
FILES 7 CHANGED
┌─ outputs/lib/color/utils.nix ──────────────────────────────────────────────┐
│ diff --git a/outputs/lib/color/utils.nix b/outputs/lib/color/utils.nix │
│ index 894a9d3..47cff82 100644 │
│ --- a/outputs/lib/color/utils.nix │
│ +++ b/outputs/lib/color/utils.nix │
│ @@ -122,6 +122,8 @@ │
│ header = args.neutrals."800"; │
│ footer = args.neutrals."800"; │
│ menu = args.neutrals."800"; │
│ + selection = args.neutrals."650"; │
│ + dimmed = args.neutrals."850"; │
│ }; │
│ border = { │
│ base = args.neutrals."650"; │
│ @@ -164,6 +166,8 @@ │
│ header = args.neutrals."150"; │
│ footer = args.neutrals."150"; │
│ menu = args.neutrals."150"; │
│ + selection = args.neutrals."300"; │
│ + dimmed = args.neutrals."200"; │
│ }; │
│ border = { │
│ base = args.neutrals."800"; │
└────────────────────────────────────────────────────────────────────────────────────┘
┌─ outputs/lib/color/utils.nix ────────┐
│ diff --git a/outputs/lib/color/utils.nix b/o │
│ utputs/lib/color/utils.nix │
│ index 894a9d3..47cff82 100644 │
│ --- a/outputs/lib/color/utils.nix │
│ +++ b/outputs/lib/color/utils.nix │
│ @@ -122,6 +122,8 @@ │
│ header = args.neutrals."800"; │
│ footer = args.neutrals."800"; │
│ menu = args.neutrals."800"; │
│ + selection = args.neutrals."650" │
│ ; │
│ + dimmed = args.neutrals."850"; │
│ }; │
│ border = { │
│ base = args.neutrals."650"; │
│ @@ -164,6 +166,8 @@ │
│ header = args.neutrals."150"; │
│ footer = args.neutrals."150"; │
│ menu = args.neutrals."150"; │
│ + selection = args.neutrals."300" │
│ ; │
│ + dimmed = args.neutrals."200"; │
│ }; │
│ border = { │
│ base = args.neutrals."800"; │
└──────────────────────────────────────────────┘
┌─ outputs/pkgs/ook-vim/config/plugins/statusline.nix ───────────────────────┐
│ diff --git a/outputs/pkgs/ook-vim/config/plugins/statusline.nix b/outputs/pkgs/ook │
│ -vim/config/plugins/statusline.nix │
│ index c9c4216..b60c12c 100644 │
│ --- a/outputs/pkgs/ook-vim/config/plugins/statusline.nix │
│ +++ b/outputs/pkgs/ook-vim/config/plugins/statusline.nix │
│ @@ -2,6 +2,7 @@ │
│ vim.statusline.lualine = { │
│ enable = true; │
│ activeSection = { │
│ + # most of this are the default values provided by nvf │
│ a = [ │
│ #lua │
│ '' │
└────────────────────────────────────────────────────────────────────────────────────┘
┌─ ...config/plugins/statusline.nix ───┐
│ diff --git a/outputs/pkgs/ook-vim/config/plu │
│ gins/statusline.nix b/outputs/pkgs/ook-vim/c │
│ onfig/plugins/statusline.nix │
│ index c9c4216..b60c12c 100644 │
│ --- a/outputs/pkgs/ook-vim/config/plugins/st │
│ atusline.nix │
│ +++ b/outputs/pkgs/ook-vim/config/plugins/st │
│ atusline.nix │
│ @@ -2,6 +2,7 @@ │
│ vim.statusline.lualine = { │
│ enable = true; │
│ activeSection = { │
│ + # most of this are the default values │
│ provided by nvf │
│ a = [ │
│ #lua │
│ '' │
└──────────────────────────────────────────────┘
┌─ outputs/pkgs/ook-vim/default.nix ─────────────────────────────────────────┐
│ diff --git a/outputs/pkgs/ook-vim/default.nix b/outputs/pkgs/ook-vim/default.nix │
│ index 40ad2fa..0196c62 100644 │
│ --- a/outputs/pkgs/ook-vim/default.nix │
│ +++ b/outputs/pkgs/ook-vim/default.nix │
│ @@ -1,11 +1,12 @@ │
│ { │
│ inputs, │
│ pkgs, │
│ + hozen, │
│ ... │
│ }: let │
│ ooks-vim = inputs.nvf.lib.neovimConfiguration { │
│ inherit pkgs; │
│ - extraSpecialArgs = {inherit inputs;}; │
│ + extraSpecialArgs = {inherit inputs hozen;}; │
│ modules = [ │
│ ./config │
│ ./modules │
└────────────────────────────────────────────────────────────────────────────────────┘
┌─ outputs/pkgs/ook-vim/default.nix ───┐
│ diff --git a/outputs/pkgs/ook-vim/default.ni │
│ x b/outputs/pkgs/ook-vim/default.nix │
│ index 40ad2fa..0196c62 100644 │
│ --- a/outputs/pkgs/ook-vim/default.nix │
│ +++ b/outputs/pkgs/ook-vim/default.nix │
│ @@ -1,11 +1,12 @@ │
│ { │
│ inputs, │
│ pkgs, │
│ + hozen, │
│ ... │
│ }: let │
│ ooks-vim = inputs.nvf.lib.neovimConfigura │
│ tion { │
│ inherit pkgs; │
│ - extraSpecialArgs = {inherit inputs;}; │
│ + extraSpecialArgs = {inherit inputs hoze │
│ n;}; │
│ modules = [ │
│ ./config │
│ ./modules │
└──────────────────────────────────────────────┘
┌─ outputs/pkgs/ook-vim/modules/plugins/default.nix ─────────────────────────┐
│ diff --git a/outputs/pkgs/ook-vim/modules/plugins/default.nix b/outputs/pkgs/ook-v │
│ im/modules/plugins/default.nix │
│ index ccd4904..18f7c03 100644 │
│ --- a/outputs/pkgs/ook-vim/modules/plugins/default.nix │
│ +++ b/outputs/pkgs/ook-vim/modules/plugins/default.nix │
│ @@ -3,5 +3,6 @@ │
│ ./gruvbox-material │
│ ./telescope │
│ ./obsidian │
│ + ./theme │
│ ]; │
│ } │
└────────────────────────────────────────────────────────────────────────────────────┘
┌─ ...m/modules/plugins/default.nix ───┐
│ diff --git a/outputs/pkgs/ook-vim/modules/pl │
│ ugins/default.nix b/outputs/pkgs/ook-vim/mod │
│ ules/plugins/default.nix │
│ index ccd4904..18f7c03 100644 │
│ --- a/outputs/pkgs/ook-vim/modules/plugins/d │
│ efault.nix │
│ +++ b/outputs/pkgs/ook-vim/modules/plugins/d │
│ efault.nix │
│ @@ -3,5 +3,6 @@ │
│ ./gruvbox-material │
│ ./telescope │
│ ./obsidian │
│ + ./theme │
│ ]; │
│ } │
└──────────────────────────────────────────────┘
┌─ outputs/pkgs/ook-vim/modules/plugins/theme/config.nix ────────────────────┐
│ diff --git a/outputs/pkgs/ook-vim/modules/plugins/theme/config.nix b/outputs/pkgs/ │
│ ook-vim/modules/plugins/theme/config.nix │
│ new file mode 100644 │
│ index 0000000..ef7872a │
│ --- /dev/null │
│ +++ b/outputs/pkgs/ook-vim/modules/plugins/theme/config.nix │
│ @@ -0,0 +1,49 @@ │
│ +{ │
│ + config, │
│ + lib, │
│ + pkgs, │
│ + ... │
│ +}: let │
│ + inherit (lib) mkIf; │
│ + inherit (lib.nvim.dag) entryBefore; │
│ + inherit (lib.nvim.lua) toLuaObject; │
│ + │
│ + cfg = config.vim.theme.custom; │
│ + │
│ + themePlugin = pkgs.vimUtils.buildVimPlugin { │
│ + inherit (cfg) name; │
│ + src = pkgs.writeTextDir "colors/${cfg.name}.lua" '' │
│ + local M = {} │
│ + M.highlights = ${toLuaObject cfg.highlights} │
│ + │
│ + local function set_groups() │
│ + for group, settings in pairs(M.highlights) do │
│ + vim.api.nvim_set_hl(0, group, settings) │
│ + end │
│ + end │
│ + │
│ + function M.colorscheme() │
│ + vim.api.nvim_command("hi clear") │
│ + if vim.fn.exists("syntax_on") then │
│ + vim.api.nvim_command("syntax reset") │
│ + end │
│ + │
│ + vim.o.termguicolors = true │
│ + vim.g.colors_name = "${cfg.name}" │
│ + │
│ + set_groups() │
│ + end │
│ + │
│ + return M.colorscheme() │
│ + ''; │
│ + }; │
│ +in { │
│ + config = mkIf cfg.enable { │
│ + vim = { │
│ + startPlugins = [themePlugin]; │
│ + luaConfigRC.customTheme = '' │
│ + vim.cmd.colorscheme("${cfg.name}") │
│ + ''; │
│ + }; │
│ + }; │
│ +} │
└────────────────────────────────────────────────────────────────────────────────────┘
┌─ ...ules/plugins/theme/config.nix ───┐
│ diff --git a/outputs/pkgs/ook-vim/modules/pl │
│ ugins/theme/config.nix b/outputs/pkgs/ook-vi │
│ m/modules/plugins/theme/config.nix │
│ new file mode 100644 │
│ index 0000000..ef7872a │
│ --- /dev/null │
│ +++ b/outputs/pkgs/ook-vim/modules/plugins/t │
│ heme/config.nix │
│ @@ -0,0 +1,49 @@ │
│ +{ │
│ + config, │
│ + lib, │
│ + pkgs, │
│ + ... │
│ +}: let │
│ + inherit (lib) mkIf; │
│ + inherit (lib.nvim.dag) entryBefore; │
│ + inherit (lib.nvim.lua) toLuaObject; │
│ + │
│ + cfg = config.vim.theme.custom; │
│ + │
│ + themePlugin = pkgs.vimUtils.buildVimPlugi │
│ n { │
│ + inherit (cfg) name; │
│ + src = pkgs.writeTextDir "colors/${cfg.n │
│ ame}.lua" '' │
│ + local M = {} │
│ + M.highlights = ${toLuaObject cfg.high │
│ lights} │
│ + │
│ + local function set_groups() │
│ + for group, settings in pairs(M.high │
│ lights) do │
│ + vim.api.nvim_set_hl(0, group, set │
│ tings) │
│ + end │
│ + end │
│ + │
│ + function M.colorscheme() │
│ + vim.api.nvim_command("hi clear") │
│ + if vim.fn.exists("syntax_on") then │
│ + vim.api.nvim_command("syntax rese │
│ t") │
│ + end │
│ + │
│ + vim.o.termguicolors = true │
│ + vim.g.colors_name = "${cfg.name}" │
│ + │
│ + set_groups() │
│ + end │
│ + │
│ + return M.colorscheme() │
│ + ''; │
│ + }; │
│ +in { │
│ + config = mkIf cfg.enable { │
│ + vim = { │
│ + startPlugins = [themePlugin]; │
│ + luaConfigRC.customTheme = '' │
│ + vim.cmd.colorscheme("${cfg.name}") │
│ + ''; │
│ + }; │
│ + }; │
│ +} │
└──────────────────────────────────────────────┘
┌─ outputs/pkgs/ook-vim/modules/plugins/theme/custom-theme.nix ──────────────┐
│ diff --git a/outputs/pkgs/ook-vim/modules/plugins/theme/custom-theme.nix b/outputs │
│ /pkgs/ook-vim/modules/plugins/theme/custom-theme.nix │
│ new file mode 100644 │
│ index 0000000..c666826 │
│ --- /dev/null │
│ +++ b/outputs/pkgs/ook-vim/modules/plugins/theme/custom-theme.nix │
│ @@ -0,0 +1,103 @@ │
│ +{lib, ...}: let │
│ + inherit (lib) mkOption mkEnableOption; │
│ + inherit (lib.types) nullOr str bool attrsOf submodule; │
│ + │
│ + highlightOpts = submodule { │
│ + options = { │
│ + # https://neovim.io/doc/user/api.html#nvim_set_hl() │
│ + fg = mkOption { │
│ + type = nullOr str; │
│ + default = null; │
│ + description = "Foreground color"; │
│ + }; │
│ + bg = mkOption { │
│ + type = nullOr str; │
│ + default = null; │
│ + description = "Background color"; │
│ + }; │
│ + sp = mkOption { │
│ + type = nullOr str; │
│ + default = null; │
│ + description = "SP color"; │
│ + }; │
│ + blend = mkOption { │
│ + type = nullOr bool; │
│ + default = null; │
│ + description = "Blend attribute"; │
│ + }; │
│ + bold = mkOption { │
│ + type = nullOr bool; │
│ + default = null; │
│ + description = "Italic attribute"; │
│ + }; │
│ + standout = mkOption { │
│ + type = nullOr bool; │
│ + default = null; │
│ + description = "Standout attribute"; │
│ + }; │
│ + underline = mkOption { │
│ + type = nullOr bool; │
│ + default = null; │
│ + description = "underline attribute"; │
│ + }; │
│ + undercurl = mkOption { │
│ + type = nullOr bool; │
│ + default = null; │
│ + description = "Undercurl attribute"; │
│ + }; │
│ + underdouble = mkOption { │
│ + type = nullOr bool; │
│ + default = null; │
│ + description = "Underdouble attribute"; │
│ + }; │
│ + underdotted = mkOption { │
│ + type = nullOr bool; │
│ + default = null; │
│ + description = "Underdotted attribute"; │
│ + }; │
│ + underdashed = mkOption { │
│ + type = nullOr bool; │
│ + default = null; │
│ + description = "Underdashed attribute"; │
│ + }; │
│ + strikethrough = mkOption { │
│ + type = nullOr bool; │
│ + default = null; │
│ + description = "Strikethrough attribute"; │
│ + }; │
│ + italic = mkOption { │
│ + type = nullOr bool; │
│ + default = null; │
│ + description = "Bold attribute"; │
│ + }; │
│ + reverse = mkOption { │
│ + type = nullOr bool; │
│ + default = null; │
│ + description = "Reverse attribute"; │
│ + }; │
│ + nocombine = mkOption { │
│ + type = nullOr bool; │
│ + default = null; │
│ + description = "Nocombine attribute"; │
│ + }; │
│ + link = mkOption { │
│ + type = nullOr str; │
│ + default = null; │
│ + description = "Link attribute"; │
│ + }; │
│ + }; │
│ + }; │
│ +in { │
│ + options.vim.theme.custom = { │
│ + enable = mkEnableOption "Enable custom theme"; │
│ + name = mkOption { │
│ + type = str; │
│ + default = "my-custom-theme"; │
│ + description = "Name of custom theme"; │
│ + }; │
│ + highlights = mkOption { │
│ + type = attrsOf highlightOpts; │
│ + default = {}; │
│ + }; │
│ + }; │
│ +} │
└────────────────────────────────────────────────────────────────────────────────────┘
┌─ ...lugins/theme/custom-theme.nix ───┐
│ diff --git a/outputs/pkgs/ook-vim/modules/pl │
│ ugins/theme/custom-theme.nix b/outputs/pkgs/ │
│ ook-vim/modules/plugins/theme/custom-theme.n │
│ ix │
│ new file mode 100644 │
│ index 0000000..c666826 │
│ --- /dev/null │
│ +++ b/outputs/pkgs/ook-vim/modules/plugins/t │
│ heme/custom-theme.nix │
│ @@ -0,0 +1,103 @@ │
│ +{lib, ...}: let │
│ + inherit (lib) mkOption mkEnableOption; │
│ + inherit (lib.types) nullOr str bool attrs │
│ Of submodule; │
│ + │
│ + highlightOpts = submodule { │
│ + options = { │
│ + # https://neovim.io/doc/user/api.html │
│ #nvim_set_hl() │
│ + fg = mkOption { │
│ + type = nullOr str; │
│ + default = null; │
│ + description = "Foreground color"; │
│ + }; │
│ + bg = mkOption { │
│ + type = nullOr str; │
│ + default = null; │
│ + description = "Background color"; │
│ + }; │
│ + sp = mkOption { │
│ + type = nullOr str; │
│ + default = null; │
│ + description = "SP color"; │
│ + }; │
│ + blend = mkOption { │
│ + type = nullOr bool; │
│ + default = null; │
│ + description = "Blend attribute"; │
│ + }; │
│ + bold = mkOption { │
│ + type = nullOr bool; │
│ + default = null; │
│ + description = "Italic attribute"; │
│ + }; │
│ + standout = mkOption { │
│ + type = nullOr bool; │
│ + default = null; │
│ + description = "Standout attribute"; │
│ + }; │
│ + underline = mkOption { │
│ + type = nullOr bool; │
│ + default = null; │
│ + description = "underline attribute" │
│ ; │
│ + }; │
│ + undercurl = mkOption { │
│ + type = nullOr bool; │
│ + default = null; │
│ + description = "Undercurl attribute" │
│ ; │
│ + }; │
│ + underdouble = mkOption { │
│ + type = nullOr bool; │
│ + default = null; │
│ + description = "Underdouble attribut │
│ e"; │
│ + }; │
│ + underdotted = mkOption { │
│ + type = nullOr bool; │
│ + default = null; │
│ + description = "Underdotted attribut │
│ e"; │
│ + }; │
│ + underdashed = mkOption { │
│ + type = nullOr bool; │
│ + default = null; │
│ + description = "Underdashed attribut │
│ e"; │
│ + }; │
│ + strikethrough = mkOption { │
│ + type = nullOr bool; │
│ + default = null; │
│ + description = "Strikethrough attrib │
│ ute"; │
│ + }; │
│ + italic = mkOption { │
│ + type = nullOr bool; │
│ + default = null; │
│ + description = "Bold attribute"; │
│ + }; │
│ + reverse = mkOption { │
│ + type = nullOr bool; │
│ + default = null; │
│ + description = "Reverse attribute"; │
│ + }; │
│ + nocombine = mkOption { │
│ + type = nullOr bool; │
│ + default = null; │
│ + description = "Nocombine attribute" │
│ ; │
│ + }; │
│ + link = mkOption { │
│ + type = nullOr str; │
│ + default = null; │
│ + description = "Link attribute"; │
│ + }; │
│ + }; │
│ + }; │
│ +in { │
│ + options.vim.theme.custom = { │
│ + enable = mkEnableOption "Enable custom │
│ theme"; │
│ + name = mkOption { │
│ + type = str; │
│ + default = "my-custom-theme"; │
│ + description = "Name of custom theme"; │
│ + }; │
│ + highlights = mkOption { │
│ + type = attrsOf highlightOpts; │
│ + default = {}; │
│ + }; │
│ + }; │
│ +} │
└──────────────────────────────────────────────┘
┌─ outputs/pkgs/ook-vim/modules/plugins/theme/default.nix ───────────────────┐
│ diff --git a/outputs/pkgs/ook-vim/modules/plugins/theme/default.nix b/outputs/pkgs │
│ /ook-vim/modules/plugins/theme/default.nix │
│ new file mode 100644 │
│ index 0000000..bf217ec │
│ --- /dev/null │
│ +++ b/outputs/pkgs/ook-vim/modules/plugins/theme/default.nix │
│ @@ -0,0 +1,6 @@ │
│ +{ │
│ + imports = [ │
│ + ./config.nix │
│ + ./custom-theme.nix │
│ + ]; │
│ +} │
└────────────────────────────────────────────────────────────────────────────────────┘
┌─ ...les/plugins/theme/default.nix ───┐
│ diff --git a/outputs/pkgs/ook-vim/modules/pl │
│ ugins/theme/default.nix b/outputs/pkgs/ook-v │
│ im/modules/plugins/theme/default.nix │
│ new file mode 100644 │
│ index 0000000..bf217ec │
│ --- /dev/null │
│ +++ b/outputs/pkgs/ook-vim/modules/plugins/t │
│ heme/default.nix │
│ @@ -0,0 +1,6 @@ │
│ +{ │
│ + imports = [ │
│ + ./config.nix │
│ + ./custom-theme.nix │
│ + ]; │
│ +} │
└──────────────────────────────────────────────┘
[ BACK TO LOG ]
──────────────────────────────────────────────────────────────────────────────────────
OOKNET
────────────────────────────────────────────────
OOKNET