bash: add logoutExtra option

This commit is contained in:
Tobias Happ 2019-07-23 23:55:41 +02:00 committed by Matthieu Coudron
parent 1499b85ac6
commit 8b759c24e6
4 changed files with 44 additions and 0 deletions

View file

@ -123,6 +123,15 @@ in
interactive shell.
'';
};
logoutExtra = mkOption {
default = "";
type = types.lines;
description = ''
Extra commands that should be run when logging out of an
interactive shell.
'';
};
};
};
@ -195,6 +204,14 @@ in
${cfg.bashrcExtra}
'';
home.file.".bash_logout" = mkIf (cfg.logoutExtra != "") {
text = ''
# -*- mode: sh -*-
${cfg.logoutExtra}
'';
};
home.packages =
optional (cfg.enableAutojump) pkgs.autojump;
}