mirror of
https://github.com/danth/stylix
synced 2024-11-26 22:20:22 +00:00
50dcc46fe6
Fixes #35 and #59 Co-authored-by: Daniel Thwaites <danthwaites30@btinternet.com>
47 lines
1 KiB
Nix
47 lines
1 KiB
Nix
{ pkgs, config, lib, ... }:
|
|
|
|
with lib;
|
|
|
|
let
|
|
themeFile = config.lib.stylix.colors {
|
|
templateRepo = pkgs.fetchFromGitHub {
|
|
owner = "chriskempson";
|
|
repo = "base16-vim";
|
|
rev = "6191622d5806d4448fa2285047936bdcee57a098";
|
|
sha256 = "6FsT87qcl9GBxgxrPx2bPULIMA/O8TRxHaN49qMM4uM=";
|
|
};
|
|
};
|
|
|
|
themePlugin = pkgs.vimUtils.buildVimPlugin {
|
|
name = "stylix";
|
|
pname = "stylix";
|
|
|
|
src = themeFile;
|
|
dontUnpack = true;
|
|
|
|
buildPhase = ''
|
|
install -D $src $out/colors/base16-stylix.vim
|
|
'';
|
|
};
|
|
|
|
vimOptions = let
|
|
fonts = config.stylix.fonts;
|
|
in {
|
|
plugins = [ themePlugin ];
|
|
extraConfig = ''
|
|
set termguicolors
|
|
colorscheme base16-stylix
|
|
unlet g:colors_name
|
|
set guifont=${escape [" "] fonts.monospace.name}:h${toString fonts.sizes.terminal}
|
|
'';
|
|
};
|
|
|
|
in {
|
|
options.stylix.targets.vim.enable =
|
|
config.lib.stylix.mkEnableTarget "Vim and/or Neovim" true;
|
|
|
|
config = lib.mkIf config.stylix.targets.vim.enable {
|
|
programs.vim = vimOptions;
|
|
programs.neovim = vimOptions;
|
|
};
|
|
}
|