Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added nord colorscheme #23

Merged
merged 3 commits into from Jul 14, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
11 changes: 7 additions & 4 deletions nixvim.nix
Expand Up @@ -204,13 +204,16 @@ in
});

configure = {
customRC = cfg.extraConfigVim + (optionalString (cfg.colorscheme != "" && cfg.colorscheme != null) ''
colorscheme ${cfg.colorscheme}
'') + ''
customRC = cfg.extraConfigVim + ''
lua <<EOF
${cfg.extraConfigLua}
EOF
'';
'' +
# Set colorscheme after setting globals.
# Some colorschemes depends on variables being set before setting the colorscheme.
(optionalString (cfg.colorscheme != "" && cfg.colorscheme != null) ''
colorscheme ${cfg.colorscheme}
'') ;

packages.nixvim = {
start = filter (f: f != null) (map
Expand Down
49 changes: 49 additions & 0 deletions plugins/colorschemes/nord.nix
@@ -0,0 +1,49 @@
{ pkgs, config, lib, ... }:
with lib;
let
cfg = config.programs.nixvim.colorschemes.nord;
in
{
options = {
programs.nixvim.colorschemes.nord = {
enable = mkEnableOption "Enable nord";

contrast = mkEnableOption
"Make sidebars and popup menus like nvim-tree and telescope have a different background";

borders = mkEnableOption
"Enable the border between verticaly split windows visable";

disable_background = mkEnableOption
"Disable the setting of background color so that NeoVim can use your terminal background";

cursorline_transparent = mkEnableOption
"Set the cursorline transparent/visible";

enable_sidebar_background = mkEnableOption
"Re-enables the background of the sidebar if you disabled the background of everything";

italic = mkOption {
description = "enables/disables italics";
type = types.nullOr types.bool;
default = null;
};
};
};

config = mkIf cfg.enable {
programs.nixvim = {
colorscheme = "nord";
extraPlugins = [ pkgs.vimPlugins.nord-nvim ];

globals = {
nord_contrast = mkIf cfg.contrast 1;
nord_borders = mkIf cfg.borders 1;
nord_disable_background = mkIf cfg.disable_background 1;
nord_cursoline_transparent = mkIf cfg.cursorline_transparent 1;
nord_enable_sidebar_background = mkIf cfg.enable_sidebar_background 1;
nord_italic = mkIf (cfg.italic != null) cfg.italic;
};
};
};
}
1 change: 1 addition & 0 deletions plugins/default.nix
Expand Up @@ -5,6 +5,7 @@

./colorschemes/base16.nix
./colorschemes/gruvbox.nix
./colorschemes/nord.nix
./colorschemes/one.nix
./colorschemes/onedark.nix
./colorschemes/tokyonight.nix
Expand Down