From 657e5e6efbd1a3a7367bd8bf44123996fbf685b5 Mon Sep 17 00:00:00 2001 From: Pedro Alves Date: Wed, 10 Feb 2021 14:20:36 +0000 Subject: [PATCH] Revert removal of types.anything, that broke mkIf --- nixvim.nix | 6 +++--- plugins/colorschemes/base16.nix | 19 +++++++++++++++++++ plugins/default.nix | 1 + 3 files changed, 23 insertions(+), 3 deletions(-) create mode 100644 plugins/colorschemes/base16.nix diff --git a/nixvim.nix b/nixvim.nix index c7b98f8a..c7ed4ec2 100644 --- a/nixvim.nix +++ b/nixvim.nix @@ -116,18 +116,18 @@ in }; configure = mkOption { - type = types.attrs; + type = types.attrsOf types.anything; default = { }; }; options = mkOption { - type = types.attrs; + type = types.attrsOf types.anything; default = { }; description = "The configuration options, e.g. line numbers"; }; globals = mkOption { - type = types.attrs; + type = types.attrsOf types.anything; default = { }; description = "Global variables"; }; diff --git a/plugins/colorschemes/base16.nix b/plugins/colorschemes/base16.nix new file mode 100644 index 00000000..7da1f516 --- /dev/null +++ b/plugins/colorschemes/base16.nix @@ -0,0 +1,19 @@ +{ pkgs, config, lib, ... }: +with lib; +let + cfg = config.programs.nixvim.colorschemes.base16; + colors = types.enum [ "bg" "red" "green" "yellow" "blue" "purple" "aqua" "gray" "fg" "bg0_h" "bg0" "bg1" "bg2" "bg3" "bg4" "gray" "orange" "bg0_s" "fg0" "fg1" "fg2" "fg3" "fg4" ]; +in { + options = { + programs.nixvim.colorschemes.base16 = { + enable = mkEnableOption "Enable base16"; + }; + }; + + config = mkIf cfg.enable { + programs.nixvim = { + colorscheme = "base16-default-dark"; + extraPlugins = [ pkgs.vimPlugins.base16-vim ]; + }; + }; +} diff --git a/plugins/default.nix b/plugins/default.nix index 72fe0349..a9751f91 100644 --- a/plugins/default.nix +++ b/plugins/default.nix @@ -1,6 +1,7 @@ { imports = [ ./colorschemes/gruvbox.nix + ./colorschemes/base16.nix ./statuslines/lightline.nix ./statuslines/airline.nix