nix/modules/stuff/vim.nix
2024-10-16 11:40:24 +02:00

27 lines
626 B
Nix

{ lib, pkgs, config, ...}: let
inherit (lib) mkIf mkEnableOption mkOption;
cfg = config.chuj.stuff.vim;
user = config.chuj.system.user;
in {
options.chuj.stuff.vim = {
enable = mkEnableOption "vim";
};
config = mkIf cfg.enable {
environment.systemPackages = [ pkgs.vim ];
home-manager.users.${user} = {
home.sessionVariables = { "EDITOR" = "vim"; };
programs.vim = {
enable = true;
defaultEditor = true;
extraConfig = ''
set laststatus=0
set shiftwidth=4 smarttab expandtab
'';
};
};
programs.nano.enable = false;
};
}