Open D3vil0p3r opened 10 months ago
I have not dug into this module so cannot help you. My only change to this module is about formatting. Please tag people more carefully next time.
BTW, it is not clear which part of your config does not work, what is the wrong behavior and what is the expected behavior. Stating those clearly helps others help you.
@jian-lin any bashrc code inside "bashrcExtra" is not run/sourced. For example, if I use all the code inserted above (or the first export variables) after the compilation, by opening a new terminal they are not echoed but result empty. Also there, where I source bash_aliases, it is not sourced:
# Bash aliases
if [ -f ~/.bash_aliases ]; then
. ~/.bash_aliases
fi
Did you test the code above to state you don't have this behavior?
I haven't tested the code you provided, but this part looks suspicious:
home.file.".bashrc".source = ./bashrc;
If you look at the programs.bash
module, you can see that it only converts the nix
code to the bashrc
file. Depending on the internals of the home-manager your code may have a higher priority than programs.bash
and nothing from bashrcExtra
gets written to the file.
What's in this ./bashrc
file? Have you tried to cat ~/.bashrc
? Is content from bashrcExtra
in there?
Thank you for your contribution! I marked this issue as stale due to inactivity. Please be considerate of people watching this issue and receiving notifications before commenting 'I have this issue too'. We welcome additional information that will help resolve this issue. Please read the relevant sections below before commenting.
* If this is resolved, please consider closing it so that the maintainers know not to focus on this. * If this might still be an issue, but you are not interested in promoting its resolution, please consider closing it while encouraging others to take over and reopen an issue if they care enough. * If you know how to solve the issue, please consider submitting a Pull Request that addresses this issue.
* If you are also experiencing this issue, please add details of your situation to help with the debugging process. * If you know how to solve the issue, please consider submitting a Pull Request that addresses this issue.
Don't be afraid to manually close an issue, even if it holds valuable information. Closed issues stay in the system for people to search, read, cross-reference, or even reopen – nothing is lost! Closing obsolete issues is an important way to help maintainers focus their time and effort.
any bashrc code inside "bashrcExtra" is not run/sourced. For example, if I use all the code inserted above (or the first export variables) after the compilation, by opening a new terminal they are not echoed but result empty. Also there, where I source bash_aliases, it is not sourced:
# Bash aliases if [ -f ~/.bash_aliases ]; then . ~/.bash_aliases fi
Did you test the code above to state you don't have this behavior?
@D3vil0p3r - Try using initExtra
instead of bashrcExtra
.
Worked for me for sourcing my ~/.bash_aliases
file. (bashrcExtra
did not).
snippet from my home.nix:
programs = {
direnv = {
enable = true;
enableBashIntegration = true; # see note on other shells below
nix-direnv.enable = true;
};
bash = {
enable = true; # see note on other shells below
initExtra = ''
source ~/.bash_aliases
'';
};
};
Are you following the right branch?
Is there an existing issue for this?
Issue description
I'm trying to implement .bashrc content in a declarative manner but if I use its content inside HM Bash module in
bashrcExtra
orinitExtra
, it does not work. The code is the following:Of course this code works if implemented in a dedicated
.bashrc
file but, since it is NixOS, the declarative approach should be a must-have. Please fix.Maintainer CC
@emilazy @rycee @jian-lin
System information