Compare commits

..

4 commits

Author SHA1 Message Date
Charlie Root
f06887b158
Merge b2f694c78e into 6670d752c7 2024-10-04 21:04:22 +00:00
Charlie Root
b2f694c78e
types/theme.nix: add check regex matching
types/theme.nix: fixed regex matching
2024-10-04 23:04:14 +02:00
Charlie Root
7ba06fd77c
theme/theme.nix: fix formatting 2024-10-04 21:36:13 +02:00
Charlie Root
e80dedd098
modules: add base16 Theming support
theme/theme.nix: fix formatting

supported-themes.nix: formatting

clean up base16-colors.nix

theme: fix plugin setup, change base16 flake input
2024-10-04 21:34:14 +02:00
9 changed files with 20 additions and 41 deletions

8
.github/README.md vendored
View file

@ -124,16 +124,10 @@ The _recommended_ way of installing **nvf** is using either the NixOS or the
Home-Manager module, though it is completely possible and no less supported to
install **nvf** as a standalone package, or a flake output.
See the rendered [nvf manual] for detailed and up-to-date installation guides,
See the [**nvf** manual] for detailed and up-to-date installation guides,
configurations, available options, release notes and more. Tips for installing
userspace plugins is also contained in the documentation.
> [!TIP]
> While using NixOS or Home-Manager modules,
> `programs.nvf.enableManpages = true;` will allow you to view option
> documentation from the comfort of your terminal via `man 5 nvf`. The more you
> know.
Please create an issue on the [issue tracker] if you find the documentation
lacking or confusing. Any improvements to the documentation through pull
requests are also welcome, and appreciated.

View file

@ -218,10 +218,6 @@ everyone.
- Add [](#opt-vim.dashboard.dashboard-nvim.setupOpts) to allow user
configuration for [dashboard.nvim](https://github.com/nvimdev/dashboard-nvim)
- Update `lualine.nvim` input and add missing themes:
- Adds `ayu`, `gruvbox_dark`, `iceberg`, `moonfly`, `onedark`,
`powerline_dark` and `solarized_light` themes.
[ppenguin](https://github.com/ppenguin):
- Telescope:

10
flake.lock generated
View file

@ -172,7 +172,7 @@
"type": "github"
}
},
"plugin-base16-nvim": {
"plugin-base16": {
"flake": false,
"locked": {
"lastModified": 1716483968,
@ -815,11 +815,11 @@
"plugin-lualine": {
"flake": false,
"locked": {
"lastModified": 1723473562,
"narHash": "sha256-gCm7m96PkZyrgjmt7Efc+NMZKStAq1zr7JRCYOgGDuE=",
"lastModified": 1712310396,
"narHash": "sha256-WcH2dWdRDgMkwBQhcgT+Z/ArMdm+VbRhmQftx4t2kNI=",
"owner": "hoob3rt",
"repo": "lualine.nvim",
"rev": "b431d228b7bbcdaea818bdc3e25b8cdbe861f056",
"rev": "0a5a66803c7407767b799067986b4dc3036e1983",
"type": "github"
},
"original": {
@ -1818,7 +1818,7 @@
"nixpkgs": "nixpkgs",
"nmd": "nmd",
"plugin-alpha-nvim": "plugin-alpha-nvim",
"plugin-base16-nvim": "plugin-base16-nvim",
"plugin-base16": "plugin-base16",
"plugin-bufdelete-nvim": "plugin-bufdelete-nvim",
"plugin-catppuccin": "plugin-catppuccin",
"plugin-ccc": "plugin-ccc",

View file

@ -349,7 +349,7 @@
};
# Themes
plugin-base16-nvim = {
plugin-base16 = {
url = "github:rrethy/base16-nvim";
flake = false;
};

View file

@ -1,13 +1,14 @@
{lib}: let
inherit (lib.strings) isString hasPrefix;
inherit (lib.strings) isString;
inherit (lib.types) mkOptionType;
inherit (builtins) stringLength;
inherit (builtins) match;
# This was almost entirely taken from raf himself.
in {
hexColorType = mkOptionType {
name = "hex-color";
descriptionClass = "noun";
description = "RGB color in hex format";
check = x: isString x && hasPrefix "#" x && stringLength x == 7;
# Check to determine wether the provided color is base16-valid
check = x: isString x && (match "#[0-9a-fA-F]{6}" x) != null;
};
}

View file

@ -17,36 +17,29 @@
"ayu_dark"
"ayu_light"
"ayu_mirage"
"ayu"
"codedark"
"dracula"
"everforest"
"gruvbox"
"gruvbox_dark"
"gruvbox_light"
"gruvbox_material"
"horizon"
"iceberg_dark"
"iceberg_light"
"iceberg"
"jellybeans"
"material"
"modus_vivendi"
"molokai"
"moonfly"
"nightfly"
"nord"
"oceanicnext"
"onedark"
"onelight"
"palenight"
"papercolor_dark"
"papercolor_light"
"powerline_dark"
"powerline"
"seoul256"
"solarized_dark"
"solarized_light"
"tomorrow"
"wombat"
];
@ -231,7 +224,7 @@ in {
local buf_ft = vim.api.nvim_get_option_value('filetype', {})
-- List of buffer types to exclude
local excluded_buf_ft = {"toggleterm", "NvimTree", "neo-tree", "TelescopePrompt"}
local excluded_buf_ft = {"toggleterm", "NvimTree", "TelescopePrompt"}
-- Check if the current buffer type is in the excluded list
for _, excluded_type in ipairs(excluded_buf_ft) do

View file

@ -1,7 +1,4 @@
{
config,
lib,
}: let
{lib}: let
inherit (lib.options) mkOption;
inherit (lib.nvim.types) hexColorType;
in {

View file

@ -7,7 +7,7 @@
inherit (lib.nvim.lua) toLuaObject;
cfg = config.vim.theme;
in {
base16-nvim = {
base16 = {
setup = {base16-colors, ...}: ''
-- Base-16 theme
require('base16-colorscheme').setup(${toLuaObject cfg.base16-colors})
@ -79,7 +79,7 @@ in {
notify = true, -- nvim-notify
which_key = true,
navic = {
enabled = true,
enabled = false,
custom_bg = "NONE", -- "lualine" will set background to mantle
},
},

View file

@ -14,7 +14,7 @@
inherit lib config;
};
base16-colors = import ./base16-colors.nix {
inherit lib config;
inherit lib;
};
in {
options.vim.theme = {
@ -47,12 +47,10 @@ in {
config = mkIf cfg.enable {
vim = {
startPlugins = [cfg.name];
luaConfigRC = {
theme = entryBefore ["pluginConfigs"] ''
luaConfigRC.theme = entryBefore ["pluginConfigs"] ''
${cfg.extraConfig}
${supportedThemes.${cfg.name}.setup {inherit (cfg) style transparent base16-colors;}}
'';
};
};
};
}