Micron Document
Guix and bashrc

It took a lot of trial and error, but I got Guix to add T383838set -o vi to my bash shell environment.

I also wanted some place holders because I can't remember what other options I generally set off the top of my head, so ultimately I settled on this to go in my config (T383838guix-home-config.scm):

updated reliable impelmentation

The original approach modified T383838.bash_profile but that would not take effect during the launch of graphical shells after having logged in from a login manager because T383838.bashrc contained a clause to stop parsing. This approach puts logic into T383838.bashrc directly so it will take effect regardless of the session. This way, new terminals inherit this environment and wont need modification to explicitly call a login shell.

(service home-bash-service-type
(home-bash-configuration
(environment-variables '(("EDITOR" . "nvim")))
(bashrc (list
(plain-file ".bashrc"
(string-join '("set -o vi"
"# others?")
"\n"))
)
)
)
)

original erroneous implementation

This approach was correct but as soon as T383838.bashrc content was generated and an x-session was used to log in, it stopped working for logged in graphical sessions. The T383838.bashrc file was being sourced by the T383838.bash_profile and inside the T383838.bashrc was a check to see if the session was interactive. If it was not, it would immediately exit and prevent further parsing of the T383838.bash_profile. Then when terminals were opened, they would inherit from this non-interactive session instead of running the login shell content interactively and resolving the problem. So I modified my approach and put content into the T383838.bashrc above.

(service home-bash-service-type
(home-bash-configuration
(environment-variables '(("EDITOR" . "nvim")))
(bash-profile (list
(plain-file "bash_profile"
(string-join '("set -o vi"
"# others?")
"\n"))
)
)
)
)

Not sure what to do for T383838keyd.conf in my T383838system.scm though. Time to dig into that.

Tags: guix

Tags
Navigation



created: 2026-04-18

(re)generated: 2026-07-17