Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vim module: init #19438

Merged
merged 1 commit into from
Oct 12, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions nixos/modules/module-list.nix
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@
./programs/ssmtp.nix
./programs/tmux.nix
./programs/venus.nix
./programs/vim.nix
./programs/wvdial.nix
./programs/xfs_quota.nix
./programs/xonsh.nix
Expand Down
24 changes: 24 additions & 0 deletions nixos/modules/programs/vim.nix
Original file line number Diff line number Diff line change
@@ -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"; };
};
}