1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-12-25 03:17:13 +00:00
nixpkgs/nixos/modules/programs/vim.nix

34 lines
726 B
Nix
Raw Normal View History

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