Make pux a script

This commit is contained in:
Sridhar Ratnakumar 2023-04-07 10:56:14 -04:00
parent d737a9da91
commit de443adbce
2 changed files with 13 additions and 14 deletions

View file

@ -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);
}

View file

@ -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 = {