mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-01 15:11:25 +00:00
25 lines
540 B
Nix
25 lines
540 B
Nix
{ 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"; };
|
|
};
|
|
}
|