mirror of
https://github.com/davegallant/nix-config
synced 2025-08-07 00:58:16 +00:00
Add cd-fzf
This commit is contained in:
@@ -197,7 +197,7 @@ in
|
|||||||
m = "make";
|
m = "make";
|
||||||
nix-install = "nix-env -iA";
|
nix-install = "nix-env -iA";
|
||||||
ps = "procs";
|
ps = "procs";
|
||||||
t = "tms";
|
t = "cd-fzf";
|
||||||
ts = "tms switch";
|
ts = "tms switch";
|
||||||
tf = "terraform";
|
tf = "terraform";
|
||||||
tree = "eza --tree";
|
tree = "eza --tree";
|
||||||
|
17
overlays/cd-fzf/cd-fzf
Executable file
17
overlays/cd-fzf/cd-fzf
Executable file
@@ -0,0 +1,17 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
readarray -t directories < ~/.config/cd-fzf
|
||||||
|
|
||||||
|
if [[ $# -eq 1 ]]; then
|
||||||
|
selected=$1
|
||||||
|
else
|
||||||
|
selected=$(find "${directories[@]}" -mindepth 1 -maxdepth 1 -type d | fzf --exact)
|
||||||
|
fi
|
||||||
|
if [[ -z $selected ]]; then
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
cd "$selected"
|
||||||
|
$SHELL
|
16
overlays/cd-fzf/default.nix
Normal file
16
overlays/cd-fzf/default.nix
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
{ stdenv, lib, fetchurl, }:
|
||||||
|
stdenv.mkDerivation rec {
|
||||||
|
pname = "cd-fzf";
|
||||||
|
version = "0.0.1";
|
||||||
|
executable = ./cd-fzf;
|
||||||
|
phases = [ "unpackPhase" ]; # Remove all other phases
|
||||||
|
unpackPhase = ''
|
||||||
|
mkdir -p $out/bin
|
||||||
|
cp ${executable} $out/bin/cd-fzf
|
||||||
|
'';
|
||||||
|
meta = with lib; {
|
||||||
|
description =
|
||||||
|
"\n Fuzzy find change directory";
|
||||||
|
platforms = platforms.unix;
|
||||||
|
};
|
||||||
|
}
|
@@ -1,4 +1,5 @@
|
|||||||
final: prev: {
|
final: prev: {
|
||||||
|
cd-fzf = prev.callPackage ./cd-fzf { };
|
||||||
sbx-h6-rgb = prev.callPackage ./sbx-h6-rgb { };
|
sbx-h6-rgb = prev.callPackage ./sbx-h6-rgb { };
|
||||||
vpngate = prev.callPackage ./vpngate { };
|
vpngate = prev.callPackage ./vpngate { };
|
||||||
}
|
}
|
||||||
|
@@ -22,6 +22,7 @@ in
|
|||||||
|
|
||||||
# modern cli
|
# modern cli
|
||||||
bat
|
bat
|
||||||
|
cd-fzf
|
||||||
doggo
|
doggo
|
||||||
eza
|
eza
|
||||||
fd
|
fd
|
||||||
|
Reference in New Issue
Block a user