bash: Make sure HISTFILE's directory exists
Co-authored-by: Robert Helgesson <robert@rycee.net>
This commit is contained in:
parent
15bd673658
commit
f99c704fe3
3 changed files with 24 additions and 2 deletions
|
|
@ -0,0 +1,20 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
{
|
||||
config = {
|
||||
programs.bash = {
|
||||
enable = true;
|
||||
historyControl = [ "erasedups" ];
|
||||
historyFile = "/home/hm-user/foo/bash/history";
|
||||
};
|
||||
|
||||
nmt.script = ''
|
||||
assertFileExists home-files/.bashrc
|
||||
|
||||
assertFileRegex home-files/.bashrc \
|
||||
'^mkdir -p "\$(dirname "\$HISTFILE")"'
|
||||
'';
|
||||
};
|
||||
}
|
||||
|
|
@ -2,4 +2,5 @@
|
|||
bash-completion = ./completion.nix;
|
||||
bash-logout = ./logout.nix;
|
||||
bash-session-variables = ./session-variables.nix;
|
||||
bash-history-control-with-file = ./bash-history-control-with-file.nix;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue