summaryrefslogtreecommitdiffstats
path: root/nixos/modules/config/vte.nix
diff options
context:
space:
mode:
authorFrederik Rietdijk <fridh@fridh.nl>2019-08-28 08:26:42 +0200
committerFrederik Rietdijk <fridh@fridh.nl>2019-08-28 08:26:42 +0200
commit5061fe0c2c7743370e1d379d6fa60eed26ff1470 (patch)
tree4a4ee79a6e0694d3c7ad6fbeff33343d83458e6c /nixos/modules/config/vte.nix
parenta2538606e3115e16db2e5075ecf37b886ad64ede (diff)
parent98640fd48212f8e6552517f667bba1901f5936d4 (diff)
Merge staging-next into staging
Diffstat (limited to 'nixos/modules/config/vte.nix')
-rw-r--r--nixos/modules/config/vte.nix52
1 files changed, 52 insertions, 0 deletions
diff --git a/nixos/modules/config/vte.nix b/nixos/modules/config/vte.nix
new file mode 100644
index 000000000000..d4a8c926fef2
--- /dev/null
+++ b/nixos/modules/config/vte.nix
@@ -0,0 +1,52 @@
+# VTE
+
+{ config, pkgs, lib, ... }:
+
+with lib;
+
+let
+
+ vteInitSnippet = ''
+ # Show current working directory in VTE terminals window title.
+ # Supports both bash and zsh, requires interactive shell.
+ . ${pkgs.vte}/etc/profile.d/vte.sh
+ '';
+
+in
+
+{
+
+ options = {
+
+ programs.bash.vteIntegration = mkOption {
+ default = false;
+ type = types.bool;
+ description = ''
+ Whether to enable Bash integration for VTE terminals.
+ This allows it to preserve the current directory of the shell
+ across terminals.
+ '';
+ };
+
+ programs.zsh.vteIntegration = mkOption {
+ default = false;
+ type = types.bool;
+ description = ''
+ Whether to enable Zsh integration for VTE terminals.
+ This allows it to preserve the current directory of the shell
+ across terminals.
+ '';
+ };
+
+ };
+
+ config = mkMerge [
+ (mkIf config.programs.bash.vteIntegration {
+ programs.bash.interactiveShellInit = mkBefore vteInitSnippet;
+ })
+
+ (mkIf config.programs.zsh.vteIntegration {
+ programs.zsh.interactiveShellInit = vteInitSnippet;
+ })
+ ];
+}