From f59ac536a2a736da4eade0a01df96605ef872e36 Mon Sep 17 00:00:00 2001 From: Noah Masur <7386960+nmasur@users.noreply.github.com> Date: Sun, 9 Mar 2025 16:31:29 +0000 Subject: [PATCH] fix neovim colors --- .../neovim/nmasur/neovim/config/colors.nix | 30 ++++++++--------- .../editors/neovim/nmasur/neovim/package.nix | 18 +++++----- .../nmasur/presets/programs/neovim.nix | 33 ++++++++++--------- 3 files changed, 42 insertions(+), 39 deletions(-) diff --git a/pkgs/applications/editors/neovim/nmasur/neovim/config/colors.nix b/pkgs/applications/editors/neovim/nmasur/neovim/config/colors.nix index 8a66f27..7aa048c 100644 --- a/pkgs/applications/editors/neovim/nmasur/neovim/config/colors.nix +++ b/pkgs/applications/editors/neovim/nmasur/neovim/config/colors.nix @@ -8,20 +8,20 @@ # Sets Neovim colors based on Nix colorscheme - # options.colors = lib.mkOption { - # type = lib.types.attrsOf lib.types.str; - # description = "Attrset of base16 colorscheme key value pairs."; - # }; + options.colors = lib.mkOption { + type = lib.types.attrsOf lib.types.str; + description = "Attrset of base16 colorscheme key value pairs."; + }; - # config = lib.mkIf config.colors { - # plugins = [ pkgs.vimPlugins.base16-nvim ]; - # setup.base16-colorscheme = config.colors; - # - # # Telescope isn't working, shut off for now - # lua = '' - # require('base16-colorscheme').with_config { - # telescope = false, - # } - # ''; - # }; + config = { + plugins = [ pkgs.vimPlugins.base16-nvim ]; + setup.base16-colorscheme = config.colors; + + # Telescope isn't working, shut off for now + lua = '' + require('base16-colorscheme').with_config { + telescope = false, + } + ''; + }; } diff --git a/pkgs/applications/editors/neovim/nmasur/neovim/package.nix b/pkgs/applications/editors/neovim/nmasur/neovim/package.nix index 14b5281..74d1fc2 100644 --- a/pkgs/applications/editors/neovim/nmasur/neovim/package.nix +++ b/pkgs/applications/editors/neovim/nmasur/neovim/package.nix @@ -28,10 +28,10 @@ { pkgs, - # colors ? null, - # terraform ? false, - # github ? false, - # kubernetes ? false, + colors ? (import ../../../../../../colorscheme/gruvbox).dark, + terraform ? false, + github ? false, + kubernetes ? false, ... }: @@ -40,15 +40,15 @@ pkgs.neovimBuilder { package = pkgs.neovim-unwrapped; inherit - # colors - # terraform - # github - # kubernetes + colors + terraform + github + kubernetes ; imports = [ ./config/align.nix ./config/bufferline.nix - # ./config/colors.nix + ./config/colors.nix ./config/completion.nix ./config/gitsigns.nix ./config/lsp.nix diff --git a/platforms/home-manager/modules/nmasur/presets/programs/neovim.nix b/platforms/home-manager/modules/nmasur/presets/programs/neovim.nix index aaf129d..2807e4e 100644 --- a/platforms/home-manager/modules/nmasur/presets/programs/neovim.nix +++ b/platforms/home-manager/modules/nmasur/presets/programs/neovim.nix @@ -28,13 +28,14 @@ in home.packages = [ cfg.package ]; - #nmasur.presets.programs.neovim.package = lib.mkDefault pkgs.nmasur-neovim.override { - # colors = cfg.colors; - # github = cfg.github.enable; - # terraform = cfg.terraform.enable; - # kubernetes = cfg.kubernetes.enable; - #}; - nmasur.presets.programs.neovim.package = pkgs.nmasur.neovim; + nmasur.presets.programs.neovim.package = lib.mkDefault ( + pkgs.nmasur.neovim.override { + colors = cfg.colors; + github = cfg.github.enable; + terraform = cfg.terraform.enable; + kubernetes = cfg.kubernetes.enable; + } + ); # Use Neovim as the editor for git commit messages programs.git.extraConfig.core.editor = "${lib.getExe cfg.package}"; @@ -61,14 +62,16 @@ in # Create a desktop option for launching Neovim from a file manager # (Requires launching the terminal and then executing Neovim) - xdg.desktopEntries.nvim = lib.mkIf (pkgs.stdenv.isLinux && config.nmasur.presets.services.i3.enable) { - name = "Neovim wrapper"; - exec = "${lib.getExe config.nmasur.presets.services.i3.terminal} nvim %F"; # TODO: change to generic - mimeType = [ - "text/plain" - "text/markdown" - ]; - }; + xdg.desktopEntries.nvim = + lib.mkIf (pkgs.stdenv.isLinux && config.nmasur.presets.services.i3.enable) + { + name = "Neovim wrapper"; + exec = "${lib.getExe config.nmasur.presets.services.i3.terminal} nvim %F"; # TODO: change to generic + mimeType = [ + "text/plain" + "text/markdown" + ]; + }; xdg.mimeApps.defaultApplications = { "text/plain" = [ "nvim.desktop" ]; "text/markdown" = [ "nvim.desktop" ];