Hi everyone!
I’m a Nixos beginner who wants to customize his own bash experience to work more efficiently. To do that, I’ve been adding my customization to the programs.bash.bashrcExtra attribute. I didn’t have any problems with adding a cool touch to my prompt but now I can’t run nixos-rebuild test nor nixos-rebuild switch, home manager complains with a set: vi: invalid option error after I tried to customize my cursor for bash vi mode command and insert modes.
The only thing that helps just once is to delete the ~/.bashrc link home manager creates and run the test command above mentioned. This is a manual solution that I came up out of curiosity to see if that could break anything but obviously it’s no the desired solution.
Here’s my home.nix code:
{ config, pkgs, … }:
let
dotfiles = “${config.home.homeDirectory}/waves-dotfiles/config”;
create_symlink = path: config.lib.file.mkOutOfStoreSymlink path;
configs = { };
in {
imports = [ ./modules/nvim/nvim.nix ./modules/tmux/tmux.nix ];
xdg.configFile = builtins.mapAttrs (name: subpath: {
source = create_symlink “${dotfiles}/${subpath}”;
recursive = true;
}) configs;
home.username = “wavesinaroom”;
home.homeDirectory = “/home/wavesinaroom”;
home.packages = with pkgs; [ glab xclip ];
programs.git = {
enable = true;
extraConfig = {
user.name = “myuser”;
user.email = ”mymail”;
init.defaultBranch = “main”;
};
};
home.stateVersion = “25.05”;
programs.bash = {
enable = true;
enableCompletion = true;
bashrcExtra = ‘‘
export PROMPT_COMMAND=“echo; trap ‘echo; trap - DEBUG’ DEBUG”
export GIT_PS1_SHOWDIRTYSTATE=true
export GIT_PS1_SHOWUNTRACKEDFILES=true
export PS1='[\e[0;36m] \w[\e[0m]$(__git_ps1)-> ';
set -o vi set show-mode-in-prompt on
set vi-cmd-mode-string “\\1\\e\[2 q\\2”
set vi-ins-mode-string “\\1\\e\[6 q\\2”
‘‘ };
}
output
Dec 04 17:37:16 hplaptop systemd[1]: Starting Home Manager environment for wavesinaroom…Dec 04 17:37:16 hplaptop hm-activate-wavesinaroom[6454]: /home/wavesinaroom/.bashrc: line 6: set: vi: invalid option nameDec 04 17:37:16 hplaptop hm-activate-wavesinaroom[6454]: /nix/store/bmcq1q46phabjginjwwk6jw8z2c53iys-hm-setup-env: line 12: /vi-ins-mode-string/activate: No such file or directory
I also deleted the set vi-ins-mode-string line but I got the same error after doing that.
I couldn’t set a proper code highlighting option here on the forum. When clicking on the code button, my code indent was gone. Sorry about that
Can anyone point out what I’m missing/doing wrong here please?