home-manager icon indicating copy to clipboard operation
home-manager copied to clipboard

bug: ` programs.bash.historyFile = "${config.xdg.dataHome}/bash/bash_history";` doesn't create the file

Open mobsenpai opened this issue 9 months ago • 4 comments

Are you following the right branch?

  • [X] My Nixpkgs and Home Manager versions are in sync

Is there an existing issue for this?

  • [X] I have searched the existing issues

Issue description

Basically setting the bash history file location doesn't create the required files leaving bash with no history files to write the history into.

Maintainer CC

@rycee

System information

- system: `"x86_64-linux"`
 - host os: `Linux 6.1.86, NixOS, 23.11 (Tapir), 23.11.20240417.e402c3e`
 - multi-user?: `no`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.18.1`
 - nixpkgs: `not found`

mobsenpai avatar Apr 29 '24 09:04 mobsenpai

I feel like this is more of a limitation of bash than anything else. I couldn't find any documentation that says that it doesn't create the necessary subdirectories, but I also did not find any documentation saying that it does create the directories.

One workaround is that you could add a mkdir -p ${config.xdg.dataHome}/bash to your programs.bash.initExtra

sumnerevans avatar May 01 '24 21:05 sumnerevans

That maybe so but that's just too hacky for me. Do you know how other users use it cuz it is an actual option in the home-manager?

mobsenpai avatar May 01 '24 21:05 mobsenpai

It does look like others are using it in the same way that you are: https://github.com/search?utf8=%E2%9C%93&q=bash.historyFile&type=code

sumnerevans avatar May 01 '24 23:05 sumnerevans

I asked other repo owners and they also don't see the files created, but they were using other shells so it didnt matter. But this is clearly an issue.

mobsenpai avatar May 04 '24 00:05 mobsenpai

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 you are the original author of the issue

  • 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 not the original author of the 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.
Memorandum on closing issues

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.

stale[bot] avatar Aug 02 '24 08:08 stale[bot]