nur-packages

My NUR packages
git clone git://git.sikmir.ru/nur-packages
Log | Files | Refs | README | LICENSE

vis.nix (917B)


      1 {
      2   config,
      3   lib,
      4   pkgs,
      5   ...
      6 }:
      7 
      8 with lib;
      9 let
     10   cfg = config.programs.vis;
     11   configDir = "${config.home.homeDirectory}/.config/vis";
     12 in
     13 {
     14   meta.maintainers = [ maintainers.sikmir ];
     15 
     16   options.programs.vis = {
     17     enable = mkEnableOption "A vim like editor";
     18 
     19     package = mkOption {
     20       default = pkgs.vis;
     21       defaultText = literalExpression "pkgs.vis";
     22       description = "vis package to install.";
     23       type = types.package;
     24     };
     25   };
     26 
     27   config = mkIf cfg.enable {
     28     home.packages = [ cfg.package ];
     29 
     30     home.file."${configDir}/visrc.lua".text = ''
     31       -- load standard vis module, providing parts of the Lua API
     32       require('vis')
     33 
     34       vis.events.subscribe(vis.events.WIN_OPEN, function(win)
     35         -- Your per window configuration options e.g.
     36         vis:command('set number on')
     37         vis:command('set tabwidth 4')
     38         vis:command('set theme zenburn')
     39       end)
     40     '';
     41   };
     42 }