mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-23 15:33:13 +00:00
26 lines
601 B
Nix
26 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"; };
|
|
};
|
|
}
|