diff --git a/aliases/btconnect.sh b/aliases/btconnect.sh new file mode 100755 index 0000000..a515406 --- /dev/null +++ b/aliases/btconnect.sh @@ -0,0 +1 @@ +bluetoothctl devices | fzf | awk '{print $2}' | xargs -r bluetoothctl connect diff --git a/nix/users/luca/zsh.nix b/nix/users/luca/zsh.nix index 90281d8..9db6173 100644 --- a/nix/users/luca/zsh.nix +++ b/nix/users/luca/zsh.nix @@ -1,13 +1,28 @@ { pkgs, ... }: +let + scripts = builtins.attrNames (builtins.readDir ../../../aliases); + aliases = builtins.concatStringsSep "\n" ( + map ( + name: + let + aliasName = builtins.replaceStrings [ ".sh" ] [ "" ] name; + in + "alias ${aliasName}='~/dotfiles/aliases/${name}'" + ) scripts + ); +in { enable = true; enableCompletion = true; autosuggestion.enable = true; syntaxHighlighting.enable = true; history.size = 1000; - envExtra = '' - export PATH="$PATH:$HOME/.rokit/bin" - ''; + envExtra = + '' + export PATH="$PATH:$HOME/.rokit/bin" + '' + + "\n" + + aliases; oh-my-zsh = { enable = true; plugins = [