From 5f9e65a1b392026016c234f3e3404c018e35ffb6 Mon Sep 17 00:00:00 2001 From: Alexandre LUCAZEAU Date: Sun, 8 Jan 2023 14:22:17 +0100 Subject: [PATCH] UPGRADE add tmux module --- hosts/dell-5590/nixos/configuration.nix | 5 +- hosts/dell-5590/nixos/services.nix | 6 ++- hosts/dell-5590/nixpkgs/configs/i3config | 4 +- hosts/dell-5590/nixpkgs/configs/init.el | 23 ++++++-- hosts/dell-5590/nixpkgs/emacs.nix | 3 ++ hosts/dell-5590/nixpkgs/home.nix | 1 + hosts/dell-5590/nixpkgs/packages.nix | 5 ++ modules/tmux.nix | 67 ++++++++++++++++++++++++ 8 files changed, 108 insertions(+), 6 deletions(-) create mode 100644 modules/tmux.nix diff --git a/hosts/dell-5590/nixos/configuration.nix b/hosts/dell-5590/nixos/configuration.nix index 6cae867..8edeaec 100644 --- a/hosts/dell-5590/nixos/configuration.nix +++ b/hosts/dell-5590/nixos/configuration.nix @@ -11,6 +11,7 @@ ./hardware-configuration.nix ./services.nix ./packages.nix +# ./vpn.nix ../modules/prometheus-node.nix ]; @@ -51,7 +52,9 @@ enable = true; extraConfig ='' load-module module-switch-on-connect + extraModules = [ pkgs.pulseaudio-modules-bt ]; ''; + package = pkgs.pulseaudioFull; }; sane = { enable = true; @@ -164,7 +167,7 @@ TERMINAL = "xfce4-terminal"; PRIVATE_BROWSER = "firefox -private"; }; - +environment.systemPackages = [ pkgs.openvpn_24 ]; users = { users.ntp.group = "ntp"; groups.ntp = {}; diff --git a/hosts/dell-5590/nixos/services.nix b/hosts/dell-5590/nixos/services.nix index 234d90c..f545f0d 100644 --- a/hosts/dell-5590/nixos/services.nix +++ b/hosts/dell-5590/nixos/services.nix @@ -6,7 +6,11 @@ services = { printing = { enable = true; - drivers = [ pkgs.brlaser ]; + drivers = [ pkgs.brlaser pkgs.hplip]; + }; + avahi = { + enable = true; + openFirewall = true; }; blueman = { diff --git a/hosts/dell-5590/nixpkgs/configs/i3config b/hosts/dell-5590/nixpkgs/configs/i3config index c65ca73..6c7b6a4 100644 --- a/hosts/dell-5590/nixpkgs/configs/i3config +++ b/hosts/dell-5590/nixpkgs/configs/i3config @@ -143,7 +143,7 @@ exec --no-startup-id nm-applet exec --no-startup-id nextcloud exec --no-startup-id udiskie -t exec --no-startup-id blueman-applet -exec --no-startup-id sublime-music +exec --no-startup-id vlc exec --no-startup-id guake exec --no-startup-id i3-msg 'workspace $ws9; exec keepassxc;' #exec --no-startup-id i3-msg 'workspace $ws5; exec emacs;' @@ -153,3 +153,5 @@ exec --no-startup-id i3-msg 'workspace $ws3; exec firefox;' exec --no-startup-id xset s off exec --no-startup-id xset -dpms + +tiling_drag modifier titlebar diff --git a/hosts/dell-5590/nixpkgs/configs/init.el b/hosts/dell-5590/nixpkgs/configs/init.el index a92b6cd..ed9e55e 100644 --- a/hosts/dell-5590/nixpkgs/configs/init.el +++ b/hosts/dell-5590/nixpkgs/configs/init.el @@ -157,7 +157,8 @@ :config (setq org-startup-folded t) (setq org-agenda-files - "~/Nextcloud/PRIVE/13_Org/agenda.org") + "~/Nextcloud/PRIVE/13_Org/agenda-DRI.org" + "~/Nextcloud/PRIVE/13_Org/perso.org") (setq org-refile-use-outline-path 'file) (setq org-refile-targets '(("~/Nextcloud/PRIVE/13_Org/DRI.org" :maxlevel . 3) @@ -170,10 +171,18 @@ ("PENDING" . (:background "#3f444a" :foreground "#ff6c6b" :weight bold)))) (setq org-capture-templates '(("i" "Inbox" entry (file "~/Nextcloud/PRIVE/13_Org/DRI.org") "* TODO %i%?") - ("a" "Agenda" entry (file "~/Nextcloud/PRIVE/13_Org/agenda.org") "* TODO %i%?\nSCHEDULED: %(org-insert-time-stamp (org-read-date nil t \"+0d\"))"))) + ("a" "Agenda" entry (file "~/Nextcloud/PRIVE/13_Org/agenda-DRI.org") "* TODO %i%?\nSCHEDULED: %(org-insert-time-stamp (org-read-date nil t \"+0d\"))"))) (setq org-agenda-custom-commands '(("t" "Today" tags-todo "+LEVEL=1+CATEGORY=\"tasks\"|+SCHEDULED<=\"\"|+DEADLINE<=\"\"")))) +(setq org-caldav-url "https://next20.produhost.net/remote.php/dav/calendars/alexandre") +(setq org-caldav-calendars + '((:calendar-id "alexandre-dri" :files ("~/Nextcloud/PRIVE/13_Org/agenda.org") + :inbox "~/Nextcloud/PRIVE/13_Org/agenda-DRI.org") + ) +) + + (use-package magit) (setq magit-fetch-modules-jobs 16); fetch 16 modules in parallel @@ -263,7 +272,7 @@ #+end_signature") (org-msg-mode) ;; Org-Roam basic configuration - (setq org-directory (concat (getenv "HOME") "/Nextcloud/PRIVE/notes")) + (setq org-directory (concat (getenv "HOME") "/Nextcloud/PRIVE/13_Org")) (use-package org-roam :after org @@ -280,3 +289,11 @@ ("C-c n t" . org-roam-tag-add) ("C-c n a" . org-roam-alias-add) ("C-c n l" . org-roam-buffer-toggle))))) +(autoload 'markdown-mode "markdown-mode" + "Major mode for editing Markdown files" t) +(add-to-list 'auto-mode-alist + '("\\.\\(?:md\\|markdown\\|mkd\\|mdown\\|mkdn\\|mdwn\\)\\'" . markdown-mode)) + +(autoload 'gfm-mode "markdown-mode" + "Major mode for editing GitHub Flavored Markdown files" t) +(add-to-list 'auto-mode-alist '("README\\.md\\'" . gfm-mode)) diff --git a/hosts/dell-5590/nixpkgs/emacs.nix b/hosts/dell-5590/nixpkgs/emacs.nix index 97c59ed..4990749 100644 --- a/hosts/dell-5590/nixpkgs/emacs.nix +++ b/hosts/dell-5590/nixpkgs/emacs.nix @@ -21,7 +21,9 @@ org org-roam org-msg + org-caldav magit + evil bbdb projectile flycheck @@ -31,6 +33,7 @@ lsp-ivy which-key elpaPackages.org + markdown-mode ])); }; diff --git a/hosts/dell-5590/nixpkgs/home.nix b/hosts/dell-5590/nixpkgs/home.nix index a9a50ef..a853394 100644 --- a/hosts/dell-5590/nixpkgs/home.nix +++ b/hosts/dell-5590/nixpkgs/home.nix @@ -14,6 +14,7 @@ # ./redshift.nix # ../../../modules/neovim.nix ../../../modules/rust.nix + ../../../modules/tmux.nix ]; home.keyboard = { layout = "fr"; diff --git a/hosts/dell-5590/nixpkgs/packages.nix b/hosts/dell-5590/nixpkgs/packages.nix index 9cdc653..bcecda9 100644 --- a/hosts/dell-5590/nixpkgs/packages.nix +++ b/hosts/dell-5590/nixpkgs/packages.nix @@ -63,8 +63,13 @@ vlc ferdi pinta + openvpn_24 + networkmanager-openvpn + python39Packages.grip + super-productivity ]; nixpkgs.config.permittedInsecurePackages = [ "ferdi-5.8.1" + "electron-17.4.1" ]; } diff --git a/modules/tmux.nix b/modules/tmux.nix new file mode 100644 index 0000000..bd52fa0 --- /dev/null +++ b/modules/tmux.nix @@ -0,0 +1,67 @@ +{ pkgs, config, ... }: +{ + programs.tmux = { + enable = true; + shortcut = "a"; + # aggressiveResize = true; -- Disabled to be iTerm-friendly + baseIndex = 1; + newSession = true; + # Stop tmux+escape craziness. + escapeTime = 0; + # Force tmux to use /tmp for sockets (WSL2 compat) + secureSocket = false; + + plugins = with pkgs; [ + tmuxPlugins.better-mouse-mode + tmuxPlugins.sidebar +# tmuxPlugins.tmux-power + ]; + + extraConfig = '' + # scrollback size + set -g history-limit 50000 + # https://old.reddit.com/r/tmux/comments/mesrci/tmux_2_doesnt_seem_to_use_256_colors/ + set -g default-terminal "xterm-256color" + set -ga terminal-overrides ",*256col*:Tc" + set -ga terminal-overrides '*:Ss=\E[%p1%d q:Se=\E[ q' + set-environment -g COLORTERM "truecolor" + + # Mouse works as expected + set-option -g mouse on + # Redraw the client (if interrupted by wall, etc) + bind R refresh-client + # reload tmux config with ctrl + b + r + unbind r + bind r \ + source-file ~/.tmux.conf \;\ + display 'Reloaded tmux config.' + # C + control q to kill sessio + unbind q + unbind C-q + bind-key q kill-session + bind-key C-q kill-session + + # Switching panes with alt + bind -n M-Left select-pane -L + bind -n M-Right select-pane -R + bind -n M-Up select-pane -U + bind -n M-Down select-pane -D + + # Visual Activity Monitoring between windows + setw -g monitor-activity on + set -g visual-activity on + + # Show tmux positions in titles + set -g set-titles on + + # Attach to a session if runs otherwise create a new one + new-session -n $HOST + ''; + }; + +# programs.tmate = { +# enable = true; + # FIXME: This causes tmate to hang. + # extraConfig = config.xdg.configFile."tmux/tmux.conf".text; +# }; +}