nur-packages

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

vis.nix (909B)


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