diff --git a/dots/.bashrc b/dots/.bashrc index 414534f..7b609fd 100644 --- a/dots/.bashrc +++ b/dots/.bashrc @@ -5,8 +5,7 @@ . /etc/os-release -# Editor & prompt configuration -[ -f "$HOME/.bashrc.d/editor" ] && . "$HOME/.bashrc.d/editor" +# Prompt configuration [ -f "$HOME/.bashrc.d/prompt" ] && . "$HOME/.bashrc.d/prompt" # Aliases {{{ diff --git a/dots/.bashrc.d/editor b/dots/.bashrc.d/editor deleted file mode 100644 index 115cff8..0000000 --- a/dots/.bashrc.d/editor +++ /dev/null @@ -1,7 +0,0 @@ -# shellcheck shell=bash -# vim: set ft=bash : - -# Set NeoVim as default editor -export EDITOR=nvim -export SUDO_EDITOR="$EDITOR" -export SYSTEMD_EDITOR="$EDITOR" diff --git a/home/modules/nvim/default.nix b/home/modules/nvim/default.nix index 2281fb4..fc58dda 100644 --- a/home/modules/nvim/default.nix +++ b/home/modules/nvim/default.nix @@ -6,15 +6,19 @@ ... }: -let - cfg = config.nvim; -in { options.nvim.enable = lib.mkEnableOption "nvim"; - config = lib.mkIf cfg.enable { - home.packages = [ - inputs.nvim.packages.${pkgs.stdenv.hostPlatform.system}.nvim - ]; + config = lib.mkIf config.nvim.enable { + home = { + sessionVariables = { + EDITOR = "nvim"; + SUDO_EDITOR = "nvim"; + SYSTEMD_EDITOR = "nvim"; + }; + packages = [ + inputs.nvim.packages.${pkgs.stdenv.hostPlatform.system}.nvim + ]; + }; }; } diff --git a/home/modules/shell/bash.nix b/home/modules/shell/bash.nix index b99d16c..9fe3791 100644 --- a/home/modules/shell/bash.nix +++ b/home/modules/shell/bash.nix @@ -54,7 +54,6 @@ in home.file = { ".inputrc".source = dotsPath + "/.inputrc"; ".bashrc.d/prompt".source = dotsPath + "/.bashrc.d/prompt"; - ".bashrc.d/editor".source = dotsPath + "/.bashrc.d/editor"; } // lib.optionalAttrs cfg.aliases.all { ".bash_aliases/all".source = dotsPath + "/.bash_aliases/all";