From de443adbce3926314484850b51b7c2504d30abc3 Mon Sep 17 00:00:00 2001 From: Sridhar Ratnakumar Date: Fri, 7 Apr 2023 10:56:14 -0400 Subject: [PATCH] Make pux a script --- home/shellcommon.nix | 18 ++++-------------- home/terminal.nix | 9 +++++++++ 2 files changed, 13 insertions(+), 14 deletions(-) diff --git a/home/shellcommon.nix b/home/shellcommon.nix index 09f467c..41bf304 100644 --- a/home/shellcommon.nix +++ b/home/shellcommon.nix @@ -1,28 +1,18 @@ -{ pkgs, lib, ... }: +{ lib, ... }: let - # These aliases should work on all shells. - shellAliasesSimple = { + shellAliases = { e = "nvim"; ee = '' fzf --bind "enter:execute(nvim {})" ''; - g = "${pkgs.git}/bin/git"; + g = "git"; lg = "lazygit"; }; - # These aliases should work on bash/zsh. - shellAliases = shellAliasesSimple // { - ls = "${pkgs.exa}/bin/exa"; - l = "ls"; - ll = "ls -l"; - lt = "ls --tree"; - # Project tmux. - pux = "sh -c \"tmux -S $(pwd).tmux attach\""; - }; in { programs.bash = { inherit shellAliases; }; programs.zsh = { inherit shellAliases; }; programs.nushell.extraConfig = - lib.concatStringsSep "\n" (lib.mapAttrsToList (k: v: "alias ${k} = ${v} ") shellAliasesSimple); + lib.concatStringsSep "\n" (lib.mapAttrsToList (k: v: "alias ${k} = ${v} ") shellAliases); } diff --git a/home/terminal.nix b/home/terminal.nix index 5c6ca74..6c6764c 100644 --- a/home/terminal.nix +++ b/home/terminal.nix @@ -7,6 +7,15 @@ ripgrep htop nix-output-monitor + + # Open tmux for current project. + (pkgs.writeShellApplication { + name = "pux"; + runtimeInputs = [ pkgs.tmux ]; + text = '' + tmux -S "$(pwd)".tmux attach + ''; + }) ]; programs = {