Skip to content

Commit

Permalink
Add basic configuration of bash and zellij
Browse files Browse the repository at this point in the history
  • Loading branch information
2639-unofficial committed Feb 29, 2024
1 parent 6d29dd7 commit e77444c
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 4 deletions.
45 changes: 45 additions & 0 deletions home-manager/bash.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
{ pkgs, config, ...}:

{
programs.bash = {
enable = true;

shellAliases = {
# Basic
l = "ls -Alh --color=auto";
".." = "cd ..";
"..." = "cd ...";

# Fast scroll back buffer clearing, like `clear`
rst = "tput reset";
};

initExtra = ''
# Create every dir along the path and cd to the path
mkcd() {
mkdir -p "$@" && cd "$_"
}
# cd up a number of directories
up() {
local d=""
local limit="$1"
# Default to limit of 1
if [ -z "$limit" ] || [ "$limit" -le 0 ]; then
limit=1
fi
for ((i=1;i<=limit;i++)); do
d="../$d"
done
# perform cd. Show error if cd fails
if ! cd "$d"; then
echo "Can't move up $limit directories.";
fi
}
'';
};
}

6 changes: 2 additions & 4 deletions home-manager/home.nix
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,18 @@
home.homeDirectory = "/home/unofficial";

imports = [
./bash.nix
./helix.nix
./zellij.nix
];

# So home-manager can set the session variables
programs.bash.enable = true;

# User packages
home.packages = with pkgs; [
firefox
btop
neofetch
pfetch
wezterm
zellij
just
fzf
];
Expand Down
8 changes: 8 additions & 0 deletions home-manager/zellij.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{ pkgs, ... }:

{
programs.zellij = {
enable = true;
enableBashIntegration = true;
};
}

0 comments on commit e77444c

Please sign in to comment.