diff --git a/.tmux.conf b/.tmux.conf new file mode 100644 index 0000000..177d393 --- /dev/null +++ b/.tmux.conf @@ -0,0 +1,20 @@ +# improve colors +set -g default-terminal 'screen-256color + +# remap leader key to ctrl-s +set -g prefix2 C-s + +# vim keymaps for switching panes +setw -g mode-keys vi +bind-key h select-pane -L +bind-key j select-pane -D +bind-key k select-pane -U +bind-key l select-pane -R +bind-key r C-h select-window -t :- +bind-key r C-h select-window -t :+ + +# plugins +set -g @plugin 'tmux-plugins/tpm' +set -g @plugin 'Nybkox/tmux-kanagawa' + +run '~/.tmux/plugins/tpm/tpm' diff --git a/flake.lock b/flake.lock index 91275dd..42b3249 100644 --- a/flake.lock +++ b/flake.lock @@ -170,11 +170,11 @@ ] }, "locked": { - "lastModified": 1738453229, - "narHash": "sha256-7H9XgNiGLKN1G1CgRh0vUL4AheZSYzPm+zmZ7vxbJdo=", + "lastModified": 1736143030, + "narHash": "sha256-+hu54pAoLDEZT9pjHlqL9DNzWz0NbUn8NEAHP7PQPzU=", "owner": "hercules-ci", "repo": "flake-parts", - "rev": "32ea77a06711b758da0ad9bd6a844c5740a87abd", + "rev": "b905f6fc23a9051a6e1b741e1438dbfc0634c6de", "type": "github" }, "original": { @@ -450,6 +450,26 @@ "type": "github" } }, + "minimal-tmux": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1730695632, + "narHash": "sha256-JtbuSxWFR94HiUdQL9uIm2V/kwGz0gbVbqvYWmEncbc=", + "owner": "niksingh710", + "repo": "minimal-tmux-status", + "rev": "d7188c1aeb1c7dd03230982445b7360f5e230131", + "type": "github" + }, + "original": { + "owner": "niksingh710", + "repo": "minimal-tmux-status", + "type": "github" + } + }, "nix-bitcoin": { "inputs": { "extra-container": "extra-container", @@ -539,11 +559,11 @@ }, "nix-secrets": { "locked": { - "lastModified": 1739387047, - "narHash": "sha256-KpogJP00vwuMIKkGJff3zp0YfV9GfOG//UzMK4nWWUw=", + "lastModified": 1737899664, + "narHash": "sha256-iZpzTSERNQ5UvFfEzrBLuEmcRUGjBSal7ShtXurYq8Q=", "ref": "refs/heads/master", - "rev": "be51e237b5b3d441a194f3e516175f6a543aee35", - "revCount": 280, + "rev": "a9844a78dcbdc8a84679835112970d80822b113c", + "revCount": 257, "type": "git", "url": "ssh://git@git.bitlab21.com/sam/nix-secrets.git" }, @@ -722,11 +742,11 @@ ] }, "locked": { - "lastModified": 1738508923, - "narHash": "sha256-4DaDrQDAIxlWhTjH6h/+xfG05jt3qDZrZE/7zDLQaS4=", + "lastModified": 1737372689, + "narHash": "sha256-nH3zK2ki0fd5o5qvbGHxukE4qnOLJa1uCzoDObG5vrE=", "owner": "NuschtOS", "repo": "search", - "rev": "86e2038290859006e05ca7201425ea5b5de4aecb", + "rev": "570cc17bbc25650eb7d69e4fcda8cfd2f1656922", "type": "github" }, "original": { @@ -767,6 +787,7 @@ "home-manager": "home-manager", "impermanence": "impermanence", "lnbits": "lnbits", + "minimal-tmux": "minimal-tmux", "nix-bitcoin": "nix-bitcoin", "nix-colors": "nix-colors", "nix-secrets": "nix-secrets", @@ -784,11 +805,11 @@ ] }, "locked": { - "lastModified": 1739262228, - "narHash": "sha256-7JAGezJ0Dn5qIyA2+T4Dt/xQgAbhCglh6lzCekTVMeU=", + "lastModified": 1737411508, + "narHash": "sha256-j9IdflJwRtqo9WpM0OfAZml47eBblUHGNQTe62OUqTw=", "owner": "mic92", "repo": "sops-nix", - "rev": "07af005bb7d60c7f118d9d9f5530485da5d1e975", + "rev": "015d461c16678fc02a2f405eb453abb509d4e1d4", "type": "github" }, "original": { @@ -886,11 +907,11 @@ ] }, "locked": { - "lastModified": 1738953846, - "narHash": "sha256-yrK3Hjcr8F7qS/j2F+r7C7o010eVWWlm4T1PrbKBOxQ=", + "lastModified": 1737483750, + "narHash": "sha256-5An1wq5U8sNycOBBg3nsDDgpwBmR9liOpDGlhliA6Xo=", "owner": "numtide", "repo": "treefmt-nix", - "rev": "4f09b473c936d41582dd744e19f34ec27592c5fd", + "rev": "f2cc121df15418d028a59c9737d38e3a90fbaf8f", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index bece91f..121eded 100644 --- a/flake.nix +++ b/flake.nix @@ -59,6 +59,11 @@ url = "git+ssh://git@git.bitlab21.com/sam/nix-secrets.git"; inputs = {}; }; + + minimal-tmux = { + url = "github:niksingh710/minimal-tmux-status"; + inputs.nixpkgs.follows = "nixpkgs"; + }; }; outputs = { diff --git a/home/common/core/default.nix b/home/common/core/default.nix index 6638cf7..0be0d08 100644 --- a/home/common/core/default.nix +++ b/home/common/core/default.nix @@ -4,6 +4,7 @@ inputs.nix-colors.homeManagerModules.default ./zsh.nix ./nixvim + ./tmux.nix ]; nixpkgs.overlays = [ diff --git a/home/common/core/tmux.nix b/home/common/core/tmux.nix new file mode 100644 index 0000000..58c4a82 --- /dev/null +++ b/home/common/core/tmux.nix @@ -0,0 +1,25 @@ +{ + pkgs, + inputs, + ... +}: { + + programs.tmux = { + enable = true; + clock24 = true; + extraConfig = '' + # vim keymaps for switching panes + setw -g mode-keys vi + bind-key h select-pane -L + bind-key j select-pane -D + bind-key k select-pane -U + bind-key l select-pane -R + bind-key -r C-h select-window -t :- + bind-key -r C-h select-window -t :+ + ''; + plugins = [ + { plugin = inputs.minimal-tmux.packages.${pkgs.system}.default; } + pkgs.tmuxPlugins.yank + ]; + }; +} diff --git a/home/common/optional/notes.nix b/home/common/optional/notes.nix index d855881..2b7255c 100644 --- a/home/common/optional/notes.nix +++ b/home/common/optional/notes.nix @@ -3,7 +3,8 @@ let user = config.home.username; in { - home.activation.get-notes = lib.hm.dag.entryAfter [ "installPackages" ] '' + home.activation.getNotes = lib.hm.dag.entryAfter [ "writeBoundary" ] '' + touch /tmp/notes notes_dir=/home/${user}/.local/share/notes remote=git@git.bitlab21.com:sam/notes if [ -d "$notes_dir" ]; @@ -13,6 +14,9 @@ in else mkdir -p "$notes_dir" && PATH="${pkgs.git}/bin:${pkgs.openssh}/bin:$PATH" git clone "$remote" "$notes_dir" fi - exit 0 + ''; + + home.activation.foo = lib.hm.dag.entryAfter [ "writeBoundary" ] '' + touch /tmp/foo ''; }