This commit is contained in:
Chris Kruining 2024-07-23 19:52:40 +02:00
parent 0e1b0a36d1
commit 2ec7c74542
4 changed files with 211 additions and 21 deletions

View file

@ -0,0 +1,30 @@
{ config, options, lib, pkgs, ... }:
let
inherit (lib.modules) mkDefault mkIf mkMerge;
cfg = config.modules.desktop.terminal;
in {
options.modules.desktop.terminal = let
inherit (lib.options) mkOption;
inherit (lib.types) str;
in {
default = mkOption {
type = str;
default = "alacrity";
description = "Default terminal";
example = "alacrity";
};
};
config = mkMerge [
{
home.sessionVariables.TERMINAL = cfg.default;
services.xserver.desktopManager.xterm.enable = mkDefault (cfg.default == "xterm");
}
(mkIf (config.modules.desktop.type == "x11") {
services.xserver.excludePackages =
mkIf (cfg.default != "xterm") [pkgs.xterm];
})
];
}