summary refs log tree commit diff
path: root/nixos/modules/programs/vim.nix
blob: fe0e7f2c6d6b9364ba605ac1eb33a1666f9fc89c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
{ 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.
      '';
    };
  };

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