diff options
Diffstat (limited to 'nixpkgs/nixos/modules/config/vte.nix')
-rw-r--r-- | nixpkgs/nixos/modules/config/vte.nix | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/nixpkgs/nixos/modules/config/vte.nix b/nixpkgs/nixos/modules/config/vte.nix new file mode 100644 index 000000000000..a969607f6e0b --- /dev/null +++ b/nixpkgs/nixos/modules/config/vte.nix @@ -0,0 +1,56 @@ +# 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 + +{ + + meta = { + maintainers = teams.gnome.members; + }; + + options = { + + programs.bash.vteIntegration = mkOption { + default = false; + type = types.bool; + description = lib.mdDoc '' + 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 = lib.mdDoc '' + 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; + }) + ]; +} |