feat(desktop): move terminal config to homes and use home-manager modules

This commit is contained in:
Mohammad Rafiq 2025-06-14 15:39:14 +08:00
parent ee2dfd8398
commit a04688d17b
No known key found for this signature in database
6 changed files with 30 additions and 25 deletions

View file

@ -14,4 +14,5 @@ mkMerge [
(import ./launcher.nix)
(import ./media-player.nix)
(import ./status-bar.nix { inherit pkgs; })
(import ./terminal.nix)
]

View file

@ -0,0 +1,4 @@
{
home.sessionVariables.TERMINAL = "ghostty -e";
programs.ghostty.settings.confirm-close-surface = false;
}

View file

@ -1,23 +0,0 @@
{
osConfig,
lib,
pkgs,
...
}:
{
config = lib.mkMerge [
(lib.mkIf (osConfig.desktop.terminal == "kitty") {
home.packages = with pkgs; [ kitty ];
home.sessionVariables.TERMINAL = "kitty";
})
(lib.mkIf (osConfig.desktop.terminal == "ghostty") {
home.sessionVariables.TERMINAL = "ghostty -e";
programs.ghostty = {
enable = true;
settings = {
confirm-close-surface = false;
};
};
})
];
}

View file

@ -22,7 +22,6 @@ in
refresh-rate = lib.pantheon.mkStrOption;
};
windowManager = lib.pantheon.mkStrOption;
terminal = lib.pantheon.mkStrOption;
enableSpotifyd = lib.mkEnableOption "";
enableSteam = lib.mkEnableOption "";
enableVR = lib.mkEnableOption "";

View file

@ -0,0 +1,24 @@
{
config,
lib,
pkgs,
...
}:
let
inherit (lib) mkEnableOption singleton optional;
inherit (pkgs) kitty;
cfg = config.desktop.terminal;
in
{
options.desktop.terminal = {
kitty.enable = mkEnableOption "";
ghostty.enable = mkEnableOption "";
};
config = {
home-manager.sharedModules = singleton {
home.packages = optional cfg.kitty.enable kitty;
programs.ghostty.enable = cfg.ghostty.enable;
};
};
}

View file

@ -7,8 +7,8 @@
media-player.vlc.enable = true;
notification-daemon.mako.enable = true;
status-bar.waybar.enable = true;
terminal.ghostty.enable = true;
windowManager = "hyprland";
terminal = "ghostty";
enableSpotifyd = true;
enableSteam = true;
enableVR = true;