sneeuwvlok/modules/desktop/terminal/default.nix
2024-07-23 19:52:40 +02:00

30 lines
734 B
Nix

{ 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];
})
];
}