From e515aae340b4ec7eba1c6d91ade6444ce3ce8db0 Mon Sep 17 00:00:00 2001 From: Christoph Hollizeck Date: Mon, 15 Dec 2025 16:45:40 +0100 Subject: [PATCH] tmux: setup for servers --- modules/base/default.nix | 5 ++++ modules/base/home/fish.nix | 19 ++++++------- modules/base/home/kitty.nix | 49 ---------------------------------- modules/base/home/terminal.nix | 37 +++++++++++++++++++++++++ modules/desktop/niri.nix | 2 -- modules/server/default.nix | 18 +++++++++++++ 6 files changed, 70 insertions(+), 60 deletions(-) delete mode 100644 modules/base/home/kitty.nix create mode 100644 modules/base/home/terminal.nix create mode 100644 modules/server/default.nix diff --git a/modules/base/default.nix b/modules/base/default.nix index 0fa8695..260cbeb 100644 --- a/modules/base/default.nix +++ b/modules/base/default.nix @@ -18,6 +18,11 @@ home = { inherit stateVersion; }; + + catppuccin = { + flavor = "mocha"; + accent = "lavender"; + }; }; nixos.base = diff --git a/modules/base/home/fish.nix b/modules/base/home/fish.nix index 639fe83..1bac34a 100644 --- a/modules/base/home/fish.nix +++ b/modules/base/home/fish.nix @@ -37,15 +37,16 @@ fish = { enable = true; shellInit = '' - set -x LESS_TERMCAP_mb \e'[01;32m' - set -x LESS_TERMCAP_md \e'[01;32m' - set -x LESS_TERMCAP_me \e'[0m' - set -x LESS_TERMCAP_se \e'[0m' - set -x LESS_TERMCAP_so \e'[01;47;34m' - set -x LESS_TERMCAP_ue \e'[0m' - set -x LESS_TERMCAP_us \e'[01;36m' - set -x LESS -R - set -x GROFF_NO_SGR 1 + # Auto-start Tmux on SSH login + if test -n "$SSH_TTY" && test -z "$TMUX" + if command -v tmux > /dev/null 2>&1 + if tmux has-session -t ssh-auto 2>/dev/null + tmux attach-session -t ssh-auto + else + tmux new-session -s ssh-auto + end + end + end ''; shellAliases = { vim = "hx"; diff --git a/modules/base/home/kitty.nix b/modules/base/home/kitty.nix deleted file mode 100644 index 2145448..0000000 --- a/modules/base/home/kitty.nix +++ /dev/null @@ -1,49 +0,0 @@ -{ - flake.modules = { - homeManager.cholli = - { pkgs, ... }: - { - catppuccin.kitty.enable = true; - - home.packages = [ - pkgs.kitty - ]; - - home.sessionVariables.TERMINAL = "kitty"; - - home.file.".config/Thunar/uca.xml".text = '' - - - - kitty - Open Kitty here - - 1726095927116900-1 - ${pkgs.kitty}/bin/kitty %f - Example for a custom action - - * - - - - - ''; - - programs.kitty = { - enable = true; - # themeFile = "tokyo_night_night"; - font = { - name = "FiraCode Nerd Font"; - size = 15; - }; - shellIntegration.enableFishIntegration = true; - settings = { - "background_opacity" = "0.90"; - "shell" = "fish"; - "confirm_os_window_close" = "0"; - }; - }; - - }; - }; -} diff --git a/modules/base/home/terminal.nix b/modules/base/home/terminal.nix new file mode 100644 index 0000000..e8e600d --- /dev/null +++ b/modules/base/home/terminal.nix @@ -0,0 +1,37 @@ +{ + flake.modules = { + homeManager.cholli = + { pkgs, ... }: + { + catppuccin.kitty.enable = true; + + home.sessionVariables.TERMINAL = "kitty"; + + programs.kitty = { + enable = true; + font = { + name = "FiraCode Nerd Font"; + size = 15; + }; + shellIntegration.enableFishIntegration = true; + settings = { + "background_opacity" = "0.90"; + "shell" = "fish"; + "confirm_os_window_close" = "0"; + }; + }; + + catppuccin.ghostty.enable = true; + programs.ghostty = { + enableFishIntegration = true; + installVimSyntax = true; + + settings = { + + }; + + }; + + }; + }; +} diff --git a/modules/desktop/niri.nix b/modules/desktop/niri.nix index 1f81685..ebc140a 100644 --- a/modules/desktop/niri.nix +++ b/modules/desktop/niri.nix @@ -70,8 +70,6 @@ { config = lib.mkIf (osConfig.networking.hostName == "yggdrasil" && osConfig.programs.niri.enable) { catppuccin = { - flavor = "mocha"; - accent = "lavender"; cursors = { enable = true; }; diff --git a/modules/server/default.nix b/modules/server/default.nix new file mode 100644 index 0000000..1a4ab66 --- /dev/null +++ b/modules/server/default.nix @@ -0,0 +1,18 @@ +{ + flake.modules.nixos.server = + { ... }: + { + programs.tmux = { + enable = true; + + clock24 = true; + newSession = true; + keyMode = "vi"; + terminal = "ghostty"; + extraConfig = '' + set -g mouse on + ''; + }; + + }; +}