nix-community / home-manager

Manage a user environment using Nix [maintainer=@rycee]
https://nix-community.github.io/home-manager/
MIT License
6k stars 1.62k forks source link

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

Open mobsenpai opened 2 weeks ago

mobsenpai commented 2 weeks ago

Are you following the right branch?

Is there an existing issue for this?

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`
sumnerevans commented 2 weeks ago

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

mobsenpai commented 2 weeks ago

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?

sumnerevans commented 2 weeks ago

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

mobsenpai commented 2 weeks ago

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.