diff --git a/home-manager/bash.nix b/home-manager/bash.nix new file mode 100644 index 0000000..4036117 --- /dev/null +++ b/home-manager/bash.nix @@ -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 + } + ''; + }; +} + diff --git a/home-manager/home.nix b/home-manager/home.nix index 51de09b..1cb8f18 100644 --- a/home-manager/home.nix +++ b/home-manager/home.nix @@ -9,12 +9,11 @@ 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 @@ -22,7 +21,6 @@ neofetch pfetch wezterm - zellij just fzf ]; diff --git a/home-manager/zellij.nix b/home-manager/zellij.nix new file mode 100644 index 0000000..3f4b0d8 --- /dev/null +++ b/home-manager/zellij.nix @@ -0,0 +1,8 @@ +{ pkgs, ... }: + +{ + programs.zellij = { + enable = true; + enableBashIntegration = true; + }; +}