From 5fb099f6fad1bf9257e8006f7f4a64d41007aad9 Mon Sep 17 00:00:00 2001 From: Ethan Simmons Date: Wed, 13 Nov 2024 12:36:34 -0600 Subject: [PATCH] Add kitty terminal to alpheratz --- flake.nix | 2 ++ modules/home/default.nix | 1 + modules/home/sway.nix | 4 +++- modules/home/term.nix | 25 +++++++++++++++++++++++++ modules/nix/gui.nix | 1 - modules/options/default.nix | 1 + modules/options/gui.nix | 6 ------ modules/options/term.nix | 26 ++++++++++++++++++++++++++ 8 files changed, 58 insertions(+), 8 deletions(-) create mode 100644 modules/home/term.nix create mode 100644 modules/options/term.nix diff --git a/flake.nix b/flake.nix index ef59531..c53d41a 100644 --- a/flake.nix +++ b/flake.nix @@ -162,6 +162,8 @@ networking = { wireguard.enable = true; }; + + term.terminal = "kitty"; }; } { diff --git a/modules/home/default.nix b/modules/home/default.nix index b0dea03..0b3f260 100644 --- a/modules/home/default.nix +++ b/modules/home/default.nix @@ -12,5 +12,6 @@ ./qt.nix ./sway.nix ./gtk.nix + ./term.nix ]; } diff --git a/modules/home/sway.nix b/modules/home/sway.nix index 3a32978..5b6ae12 100644 --- a/modules/home/sway.nix +++ b/modules/home/sway.nix @@ -8,6 +8,7 @@ with lib; let gui = config.simmer.gui; + term = config.simmer.term; laptop = config.simmer.laptop; modifier = "Mod4"; in @@ -56,7 +57,7 @@ in "XF86AudioMute" = "exec --no-startup-id pactl set-sink-mute @DEFAULT_SINK@ toggle"; "XF86AudioMicMute" = "exec --no-startup-id pactl set-source-mute @DEFAULT_SOURCE@ toggle"; "${modifier}+space" = "exec \"kickoff-dot-desktop | ${pkgs.kickoff}/bin/kickoff --from-stdin --stdout | xargs -d '\\n' ${pkgs.sway}/bin/swaymsg exec\""; - "${modifier}+Return" = "exec alacritty "; + "${modifier}+Return" = "exec ${term.terminal}"; "${modifier}+Control+f" = "exec MOZ_ENABLE_WAYLAND=1 firefox"; "${modifier}+Control+t" = "exec thunar"; "${modifier}+Control+h" = "exec helvum"; @@ -209,6 +210,7 @@ in commands = [ { criteria = { class = "vesktop"; }; command = "opacity 0.9"; } { criteria = { app_id = "Alacritty"; }; command = "opacity 0.9"; } + { criteria = { app_id = "kitty"; }; command = "opacity 0.9"; } { criteria = { class = "feishin"; }; command = "opacity 0.9"; } { criteria = { class = "gamescope"; }; command = "fullscreen"; } { criteria = { app_id = "gamescope"; }; command = "fullscreen"; } diff --git a/modules/home/term.nix b/modules/home/term.nix new file mode 100644 index 0000000..1cdb66c --- /dev/null +++ b/modules/home/term.nix @@ -0,0 +1,25 @@ +{ lib +, pkgs +, config +, ... +}: + +with lib; let + cfg = config.simmer.term; +in +{ + + config = { + programs.kitty = mkIf (cfg.terminal == "kitty") { + enable = true; + settings = { + confirm_os_window_close = 0; + }; + }; + + programs.alacritty = mkIf (cfg.terminal == "alacritty") { + enable = true; + }; + }; + +} diff --git a/modules/nix/gui.nix b/modules/nix/gui.nix index c083773..d623bd7 100644 --- a/modules/nix/gui.nix +++ b/modules/nix/gui.nix @@ -24,7 +24,6 @@ in mpv feh ] - ++ [ cfg.terminal ] ++ optional cfg.matrix cinny-desktop ++ optional cfg.secrets libsecret ++ optionals cfg.protonmail [ thunderbird protonmail-bridge ]; diff --git a/modules/options/default.nix b/modules/options/default.nix index 051555f..b8cb4ad 100644 --- a/modules/options/default.nix +++ b/modules/options/default.nix @@ -16,5 +16,6 @@ ./system.nix ./laptop.nix ./school.nix + ./term.nix ]; } diff --git a/modules/options/gui.nix b/modules/options/gui.nix index 98da05f..85fb2d9 100644 --- a/modules/options/gui.nix +++ b/modules/options/gui.nix @@ -33,12 +33,6 @@ in }; - terminal = mkOption { - description = "Which terminal to install (alacritty)"; - type = types.enum [ pkgs.alacritty ]; - default = pkgs.alacritty; - }; - gtk = mkOption { description = "Whether to configure gtk"; type = types.bool; diff --git a/modules/options/term.nix b/modules/options/term.nix new file mode 100644 index 0000000..1e45822 --- /dev/null +++ b/modules/options/term.nix @@ -0,0 +1,26 @@ +{ lib +, pkgs +, config +, ... +}: + +with lib; let + cfg = config.simmer.term; + gui = config.simmer.gui; +in +{ + options.simmer.term = { + enable = mkOption { + description = "Whether to install and configure a terminal"; + type = types.bool; + default = gui.enable; + }; + + terminal = mkOption { + description = "Which terminal to install (alcritty, kitty)"; + type = types.enum [ "alacritty" "kitty" ]; + default = "alacritty"; + }; + }; + +}