vim module: init
This commit is contained in:
parent
b44e79e240
commit
8c21021f0f
|
@ -84,6 +84,7 @@
|
||||||
./programs/ssmtp.nix
|
./programs/ssmtp.nix
|
||||||
./programs/tmux.nix
|
./programs/tmux.nix
|
||||||
./programs/venus.nix
|
./programs/venus.nix
|
||||||
|
./programs/vim.nix
|
||||||
./programs/wvdial.nix
|
./programs/wvdial.nix
|
||||||
./programs/xfs_quota.nix
|
./programs/xfs_quota.nix
|
||||||
./programs/xonsh.nix
|
./programs/xonsh.nix
|
||||||
|
|
24
nixos/modules/programs/vim.nix
Normal file
24
nixos/modules/programs/vim.nix
Normal file
|
@ -0,0 +1,24 @@
|
||||||
|
{ 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"; };
|
||||||
|
};
|
||||||
|
}
|
Loading…
Reference in a new issue