From af1f1fec2ed8890574dcffca192b51338eb6e825 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20B=C3=B6hme?= Date: Tue, 25 Apr 2023 19:50:28 +0200 Subject: [PATCH] feat(programs): add navi --- modules/profiles/base.nix | 3 ++- modules/programs/default.nix | 1 + modules/programs/navi/cheats/reptyr.cheat | 6 ++++++ modules/programs/navi/default.nix | 20 ++++++++++++++++++++ 4 files changed, 29 insertions(+), 1 deletion(-) create mode 100644 modules/programs/navi/cheats/reptyr.cheat create mode 100644 modules/programs/navi/default.nix diff --git a/modules/profiles/base.nix b/modules/profiles/base.nix index 1dab08b..6f2fb3f 100644 --- a/modules/profiles/base.nix +++ b/modules/profiles/base.nix @@ -62,6 +62,7 @@ in fish.enable = true; git.enable = true; gpg.enable = true; + navi.enable = true; tmux.enable = true; }; }; @@ -99,6 +100,7 @@ in exa gparted neofetch + reptyr ripgrep up viu @@ -143,7 +145,6 @@ in ]; }; zoxide.enable = true; - navi.enable = true; }; home = { username = "moritz"; diff --git a/modules/programs/default.nix b/modules/programs/default.nix index 1617f40..bf1d830 100644 --- a/modules/programs/default.nix +++ b/modules/programs/default.nix @@ -18,6 +18,7 @@ ./ledger ./logseq.nix ./miracast.nix + ./navi ./nvim ./python.nix ./rofi diff --git a/modules/programs/navi/cheats/reptyr.cheat b/modules/programs/navi/cheats/reptyr.cheat new file mode 100644 index 0000000..1ea2e55 --- /dev/null +++ b/modules/programs/navi/cheats/reptyr.cheat @@ -0,0 +1,6 @@ +% tmux, reptyr + +# send background process to tmux +bg && disown && tmux new "$SHELL -c 'reptyr '" + +$ process: ps x -eo pid,tty,stat | awk '$2 ~ /pts/' | awk '$3 ~ /T/' | cut -d" " -f1 --- --preview "ps -p {} -o cmd" diff --git a/modules/programs/navi/default.nix b/modules/programs/navi/default.nix new file mode 100644 index 0000000..1772d61 --- /dev/null +++ b/modules/programs/navi/default.nix @@ -0,0 +1,20 @@ +{ config, lib, ... }: + +with lib; +let + cfg = config.my.programs.navi; +in +{ + options.my.programs.navi.enable = mkEnableOption "navi"; + + config = mkIf cfg.enable { + home-manager.users.moritz = { + programs.navi.enable = true; + xdg.dataFile."navi/cheats/personal" = { + enable = true; + recursive = true; + source = ./cheats; + }; + }; + }; +}