refactor(nvim): nixify editor bash config

This commit is contained in:
2026-08-23 13:32:24 +02:00
parent db31984573
commit 4f77043e3b
4 changed files with 12 additions and 17 deletions
+1 -2
View File
@@ -5,8 +5,7 @@
. /etc/os-release . /etc/os-release
# Editor & prompt configuration # Prompt configuration
[ -f "$HOME/.bashrc.d/editor" ] && . "$HOME/.bashrc.d/editor"
[ -f "$HOME/.bashrc.d/prompt" ] && . "$HOME/.bashrc.d/prompt" [ -f "$HOME/.bashrc.d/prompt" ] && . "$HOME/.bashrc.d/prompt"
# Aliases {{{ # Aliases {{{
-7
View File
@@ -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"
+11 -7
View File
@@ -6,15 +6,19 @@
... ...
}: }:
let
cfg = config.nvim;
in
{ {
options.nvim.enable = lib.mkEnableOption "nvim"; options.nvim.enable = lib.mkEnableOption "nvim";
config = lib.mkIf cfg.enable { config = lib.mkIf config.nvim.enable {
home.packages = [ home = {
inputs.nvim.packages.${pkgs.stdenv.hostPlatform.system}.nvim sessionVariables = {
]; EDITOR = "nvim";
SUDO_EDITOR = "nvim";
SYSTEMD_EDITOR = "nvim";
};
packages = [
inputs.nvim.packages.${pkgs.stdenv.hostPlatform.system}.nvim
];
};
}; };
} }
-1
View File
@@ -54,7 +54,6 @@ in
home.file = { home.file = {
".inputrc".source = dotsPath + "/.inputrc"; ".inputrc".source = dotsPath + "/.inputrc";
".bashrc.d/prompt".source = dotsPath + "/.bashrc.d/prompt"; ".bashrc.d/prompt".source = dotsPath + "/.bashrc.d/prompt";
".bashrc.d/editor".source = dotsPath + "/.bashrc.d/editor";
} }
// lib.optionalAttrs cfg.aliases.all { // lib.optionalAttrs cfg.aliases.all {
".bash_aliases/all".source = dotsPath + "/.bash_aliases/all"; ".bash_aliases/all".source = dotsPath + "/.bash_aliases/all";