nixpkgs/nixos/modules/programs/vim.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

28 lines
602 B
Nix
Raw Normal View History

2016-10-10 20:49:43 +00:00
{ config, lib, pkgs, ... }:
with lib;
let
cfg = config.programs.vim;
in {
options.programs.vim = {
defaultEditor = mkOption {
type = types.bool;
default = false;
description = lib.mdDoc ''
When enabled, installs vim and configures vim to be the default editor
using the EDITOR environment variable.
'';
};
package = mkPackageOption pkgs "vim" {
example = "vim-full";
};
2016-10-10 20:49:43 +00:00
};
config = mkIf cfg.defaultEditor {
environment.systemPackages = [ cfg.package ];
environment.variables = { EDITOR = mkOverride 900 "vim"; };
2016-10-10 20:49:43 +00:00
};
}