Skip to content

Commit

Permalink
neovim: use bas16 manually
Browse files Browse the repository at this point in the history
  • Loading branch information
kmein committed Dec 13, 2024
1 parent 2c6007d commit f8c3a9d
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 4 deletions.
6 changes: 5 additions & 1 deletion configs/neovim.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
pkgs,
niveumPackages,
config,
...
}: {
environment.variables.EDITOR = pkgs.lib.mkForce "nvim";
Expand Down Expand Up @@ -35,7 +36,10 @@

environment.systemPackages = [
(pkgs.writers.writeDashBin "vim" ''neovim "$@"'')
niveumPackages.vim
(niveumPackages.vim.override {
stylixColors = config.lib.stylix.colors;
colorscheme = if config.networking.hostName == "fatteh" then "base16-grayscale-light" else "base16-grayscale-dark";
})

# language servers
pkgs.pyright
Expand Down
2 changes: 0 additions & 2 deletions lib/vim/init.vim
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ vnoremap a= :Tabularize /=<CR>
vnoremap a; :Tabularize /::<CR>
vnoremap a- :Tabularize /-><CR>
colorscheme dim

" noremap <Leader>h :<C-u>split<CR>
" noremap <Leader>v :<C-u>vsplit<CR>
noremap <Leader>gs :Git<CR>
Expand Down
16 changes: 16 additions & 0 deletions packages/vim.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
fetchFromGitHub,
vimUtils,
niveumPackages,
writeText,
stylixColors ? null,
colorscheme ? null,
lib,
...
}: (neovim.override {
configure = {
Expand All @@ -12,9 +16,21 @@
source ${../lib/vim/init.vim}
let g:snippet_directory = '${vimPlugins.friendly-snippets}'
luafile ${../lib/vim/init.lua}
'' + lib.optionalString (stylixColors != null) (with stylixColors.withHashtag; ''
luafile ${writeText "colors.lua" ''
require('base16-colorscheme').setup({
base00 = '${base00}', base01 = '${base01}', base02 = '${base02}', base03 = '${base03}',
base04 = '${base04}', base05 = '${base05}', base06 = '${base06}', base07 = '${base07}',
base08 = '${base08}', base09 = '${base09}', base0A = '${base0A}', base0B = '${base0B}',
base0C = '${base0C}', base0D = '${base0D}', base0E = '${base0E}', base0F = '${base0F}'
})
''}
'') + lib.optionalString (colorscheme != null) ''
colorscheme ${colorscheme}
'';
packages.nvim = with vimPlugins; {
start = [
base16-nvim
nvim-cmp
cmp-buffer
cmp-path
Expand Down
2 changes: 1 addition & 1 deletion systems/fatteh/configuration.nix
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ in {

services.illum.enable = true;

stylix.base16Scheme = "${pkgs.base16-schemes}/share/themes/selenized-light.yaml";
stylix.base16Scheme = "${pkgs.base16-schemes}/share/themes/grayscale-light.yaml";

age.secrets = {
retiolum-rsa = {
Expand Down

0 comments on commit f8c3a9d

Please sign in to comment.