mirror of
https://github.com/nix-community/nixvim.git
synced 2025-06-21 08:35:43 +02:00
This represents a major rearchitecture for nixvim, so I'm leaving this up to track the progress for now, and to serve as a reference for any breaking changes during transition. The main change is, of course, being able to use nixvim standalone. To do this, you should use the new build function, which takes in two arguments: the system architecture (e.g. x86_64-linux) and the configuration. For the new configuration, do not use the programs.nixvim. prefix. For module development, the main change is that you should no longer prefix your modules with programs.nixvim..
73 lines
1.8 KiB
Nix
73 lines
1.8 KiB
Nix
{ pkgs, config, lib, ... }:
|
|
with lib;
|
|
let
|
|
cfg = config.plugins.notify;
|
|
helpers = import ../helpers.nix { lib = lib; };
|
|
icon = mkOption {
|
|
type = types.nullOr types.str;
|
|
default = null;
|
|
};
|
|
in
|
|
{
|
|
options.plugins.notify = {
|
|
enable = mkEnableOption "Enable notify";
|
|
|
|
stages = mkOption {
|
|
type = types.nullOr (types.enum [ "fade_in_slide_out" "fade" "slide" "static" ]);
|
|
description = "Animation style";
|
|
default = null;
|
|
};
|
|
timeout = mkOption {
|
|
type = types.nullOr types.int;
|
|
description = "Default timeout for notifications";
|
|
default = null;
|
|
};
|
|
backgroundColor = mkOption {
|
|
type = types.nullOr types.str;
|
|
description = "For stages that change opacity this is treated as the highlight between the window";
|
|
default = null;
|
|
};
|
|
minimumWidth = mkOption {
|
|
type = types.nullOr types.int;
|
|
description = "Minimum width for notification windows";
|
|
default = null;
|
|
};
|
|
icons = mkOption {
|
|
type = types.nullOr (types.submodule {
|
|
options = {
|
|
error = icon;
|
|
warn = icon;
|
|
info = icon;
|
|
debug = icon;
|
|
trace = icon;
|
|
};
|
|
});
|
|
description = "Icons for the different levels";
|
|
default = { };
|
|
};
|
|
};
|
|
|
|
config =
|
|
let
|
|
setupOptions = with cfg; {
|
|
stages = stages;
|
|
timeout = timeout;
|
|
background_color = backgroundColor;
|
|
minimum_width = minimumWidth;
|
|
icons = with icons; {
|
|
ERROR = error;
|
|
WARN = warn;
|
|
INFO = info;
|
|
DEBUG = debug;
|
|
TRACE = trace;
|
|
};
|
|
};
|
|
in
|
|
mkIf cfg.enable {
|
|
extraPlugins = [ pkgs.vimPlugins.nvim-notify ];
|
|
extraConfigLua = ''
|
|
vim.notify = require('notify');
|
|
require('notify').setup(${helpers.toLuaObject setupOptions})
|
|
'';
|
|
};
|
|
}
|