5c370c0b2a
GitOrigin-RevId: 33d1e753c82ffc557b4a585c77de43d4c922ebb5
25 lines
601 B
Nix
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"; };
|
|
};
|
|
}
|