depot/third_party/nixpkgs/nixos/modules/programs/vim.nix
Default email 5c370c0b2a Project import generated by Copybara.
GitOrigin-RevId: 33d1e753c82ffc557b4a585c77de43d4c922ebb5
2024-05-15 17:35:15 +02:00

25 lines
601 B
Nix

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