Skip to content

Commit

Permalink
vim module: init
Browse files Browse the repository at this point in the history
  • Loading branch information
primeos committed Oct 10, 2016
1 parent b44e79e commit 8c21021
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
1 change: 1 addition & 0 deletions nixos/modules/module-list.nix
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@
./programs/ssmtp.nix
./programs/tmux.nix
./programs/venus.nix
./programs/vim.nix
./programs/wvdial.nix
./programs/xfs_quota.nix
./programs/xonsh.nix
Expand Down
24 changes: 24 additions & 0 deletions nixos/modules/programs/vim.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{ config, lib, pkgs, ... }:

with lib;

let
cfg = config.programs.vim;
in {
options.programs.vim = {
defaultEditor = mkOption {
type = types.bool;
default = false;
example = true;
description = ''
When enabled, installs vim and configures vim to be the default editor
using the EDITOR environment variable.
'';
};
};

config = mkIf cfg.defaultEditor {
environment.systemPackages = [ pkgs.vim ];
environment.variables = { EDITOR = mkOverride 900 "vim"; };
};
}

0 comments on commit 8c21021

Please sign in to comment.