diff --git a/modules/hosts/dnsc-server/default.nix b/modules/hosts/dnsc-server/default.nix index 770f2e0..800a616 100644 --- a/modules/hosts/dnsc-server/default.nix +++ b/modules/hosts/dnsc-server/default.nix @@ -10,6 +10,7 @@ in inputs.agenix.nixosModules.default home-manager base + server-shell git ssh zfs @@ -20,26 +21,29 @@ in restic samba-share - ({ config, ... }: { - imports = [ ./_hardware-configuration.nix ]; - networking.hostName = hostname; - networking.hostId = "e5d5a602"; - system.stateVersion = "24.11"; + ( + { config, ... }: + { + imports = [ ./_hardware-configuration.nix ]; + networking.hostName = hostname; + networking.hostId = "e5d5a602"; + system.stateVersion = "24.11"; - # Secrets for this machine - age = { - identityPaths = [ - "${config.users.users.dennis.home}/.ssh/id_ed25519" - ]; - secrets."restic/password" = { - file = "${secretsDir}/restic/password.age"; + # Secrets for this machine + age = { + identityPaths = [ + "${config.users.users.dennis.home}/.ssh/id_ed25519" + ]; + secrets."restic/password" = { + file = "${secretsDir}/restic/password.age"; + }; }; - }; - # Options for my custom modules - samba-share.path = "/main/share"; - samba-share.allowedHosts = "192.168.178. 127.0.0.1 localhost"; - }) + # Options for my custom modules + samba-share.path = "/main/share"; + samba-share.allowedHosts = "192.168.178. 127.0.0.1 localhost"; + } + ) ]; }; } diff --git a/modules/server-shell/default.nix b/modules/server-shell/default.nix new file mode 100644 index 0000000..4a6fc12 --- /dev/null +++ b/modules/server-shell/default.nix @@ -0,0 +1,81 @@ +{ + inputs, + ... +}: +{ + flake.modules.nixos.server-shell = + { pkgs, ... }: + { + programs.bash.enable = true; + + home-manager.sharedModules = [ + inputs.self.modules.homeManager.server-shell + ]; + }; + + flake.modules.homeManager.server-shell = + { pkgs, ... }: + { + home.packages = with pkgs; [ + neovim + tmux + iotop + iftop + ]; + + programs.tmux = { + enable = true; + package = pkgs.tmux; + baseIndex = 1; + clock24 = true; + disableConfirmationPrompt = true; + mouse = true; + newSession = true; + prefix = "C-a"; + terminal = "screen-256color"; + keyMode = "vi"; + escapeTime = 0; + extraConfig = '' + set -g status-position bottom + set -g status-style bg=#1d202f,fg=white + set -g status-left "" + set -g status-right "#[bg=default,fg=magenta]>> #S << #[bg=default,fg=white]#H " + set-window-option -g window-status-style 'fg=magenta,bg=#1d202f' + set-window-option -g window-status-format ' #I #[fg=white]#W #[fg=cyan]#F ' + set-window-option -g window-status-current-style "fg=black,bg=magenta" + set-window-option -g window-status-current-format " #I #W #F " + set -g pane-border-style fg=#807c9f + set -g pane-active-border-style fg=magenta + set -g message-style "fg=black,bg=red,bold" + + unbind % + bind "|" split-window -h + unbind '"' + bind - split-window -l 15 -v + + bind r source-file "~/.config/tmux/tmux.conf" + + bind h select-pane -L + bind j select-pane -D + bind k select-pane -U + bind l select-pane -R + + bind -r H resize-pane -L 5 + bind -r J resize-pane -D 5 + bind -r K resize-pane -U 5 + bind -r L resize-pane -R 5 + + bind ? list-keys -a + + unbind s + bind s display-popup -h 50% -w 80% -E sessionizer + + unbind C-x + bind C-x kill-session + + unbind v + bind v choose-tree -Zw "join-pane -t '%%'" + ''; + }; + }; +}