users/foo-dogsquared/programs/terminal-emulator: init

This commit is contained in:
Gabriel Arazas 2024-12-04 16:28:50 +08:00
parent 56820b1611
commit b05e18cf0c
No known key found for this signature in database
GPG Key ID: 62104B43D00AA360
3 changed files with 45 additions and 0 deletions

View File

@ -14,6 +14,7 @@
./programs/custom-homepage.nix
./programs/shell.nix
./programs/terminal-multiplexer.nix
./programs/terminal-emulator.nix
./programs/vs-code.nix
./services/backup

View File

@ -0,0 +1,43 @@
{ config, lib, pkgs, ... }:
let
userCfg = config.users.foo-dogsquared;
cfg = userCfg.programs.terminal-emulator;
shellIntegrationFragment = ''
source ${pkgs.bash-preexec}/share/bash/bash-preexec.sh
source ${config.programs.wezterm.package}/etc/profile.d/wezterm.sh
'';
in
{
options.users.foo-dogsquared.programs.terminal-emulator.enable =
lib.mkEnableOption "foo-dogsquared's terminal emulator setup";
config = lib.mkIf cfg.enable {
programs.bash.initExtra = shellIntegrationFragment;
programs.zsh.initExtra = shellIntegrationFragment;
# We're just making a version of Wezterm with the default arguments if
# the user has them.
home.packages =
let
inherit (pkgs) wezterm;
weztermUserDefaultDesktop = pkgs.makeDesktopItem {
name = "wezterm-user-default-args";
desktopName = "WezTerm (user)";
comment = "Wez's Terminal Emulator";
keywords = [ "shell" "prompt" "command" "commandline" "cmd" ];
icon = "org.wezfurlong.wezterm";
startupWMClass = "org.wezfurlong.wezterm";
tryExec = "wezterm";
exec = "wezterm";
type = "Application";
categories = [ "System" "TerminalEmulator" "Utility" ];
};
in
[
wezterm
weztermUserDefaultDesktop
];
};
}

View File

@ -25,6 +25,7 @@ in {
keys.gpg.enable = true;
keys.ssh.enable = true;
terminal-multiplexer.enable = lib.mkDefault true;
terminal-emulator.enable = lib.mkDefault true;
};
suites.dev = {