From 02e359e44e49a3a0c9d7f297d62a0509e967a1be Mon Sep 17 00:00:00 2001 From: maxstrb Date: Thu, 6 Nov 2025 14:54:27 +0100 Subject: [PATCH] non important commit --- home/modules/shells.nix | 75 +++++------------------------------------ 1 file changed, 9 insertions(+), 66 deletions(-) diff --git a/home/modules/shells.nix b/home/modules/shells.nix index a222876..16b367a 100644 --- a/home/modules/shells.nix +++ b/home/modules/shells.nix @@ -5,6 +5,8 @@ }: { home.packages = with pkgs; [ bat + fzf + fd ]; home.sessionVariables = { @@ -47,61 +49,13 @@ fastfetch } - - def flake [...command: string] { - let git_result = do { git rev-parse --show-toplevel } | complete - if $git_result.exit_code != 0 { - print "You are not in a git repository" - return - } - let root = $git_result.stdout | str trim - let flake_path = $root | path join "flake.nix" - if not ($flake_path | path exists) { - print "There is no flake in this repository" - return - } - let dev_check = do { nix develop $root --command true } | complete - if $dev_check.exit_code == 0 { - if ($command | is-empty) { - nix develop $root - } else { - nix develop $root --command ...$command - } - } else { - print "This flake doesn't have a default shell" - } - } - - def edit [user_file?: path] { - let file = if ($user_file | is-empty) { - pwd - } else { - $user_file - } - - let git_result = do { git rev-parse --show-toplevel } | complete - if $git_result.exit_code != 0 { - nvim $file - return - } - - let root = $git_result.stdout | str trim - let flake_path = $root | path join "flake.nix" - if not ($flake_path | path exists) { - nvim $file - return - } - - let dev_check = do { nix develop $root --command true } | complete - - if $dev_check.exit_code == 0 { - if ($user_file | is-empty) { - nix develop $root --command nvim - } else { - nix develop $root --command nvim $file - } - } else { - nvim $file + def --env f [] { + let dir = ( + fd --type d --follow --exclude .git + | fzf --height 40% --reverse --border + ) + if ($dir != "") { + cd $dir } } @@ -130,19 +84,8 @@ home = "edit /home/maxag/.nix-config/home/${device-name}/home.nix"; config = "edit /home/maxag/.nix-config/configuration/${device-name}/configuration.nix"; cat = "bat -p -P"; - nvim = "edit"; nix-shell = "nix-shell --run nu"; }; }; - - zoxide = { - enable = true; - enableBashIntegration = true; - enableNushellIntegration = true; - - options = [ - "--cmd cd" - ]; - }; }; }