From 3b264457e9892e060bfac9ab7b81d1b2b54fc8df Mon Sep 17 00:00:00 2001 From: maxstrb Date: Wed, 1 Oct 2025 21:31:15 +0200 Subject: [PATCH] non important commit --- home/modules/shells.nix | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/home/modules/shells.nix b/home/modules/shells.nix index 9e69a94..5b48292 100644 --- a/home/modules/shells.nix +++ b/home/modules/shells.nix @@ -41,26 +41,29 @@ fastfetch } - def edit [file?: path] { - if ($file | is-empty) or ($file == null) { - $file = pwd + def edit [user_file?: path] { + let file = if ($user_file | is-empty) or ($user_file == null) { + pwd + } else { + $user_file } let git_result = do { git rev-parse --show-toplevel } | complete if $git_result.exit_code == 0 { let root = $git_result.stdout | str trim - let flake_path = $root | path join "flake.nix" + if not ($flake_path | path exists) { nvim $file return } cd $root - nix develop . --command bash -c $"nvim ($file)" + # Pass nvim directly as the command instead of wrapping in bash -c + nix develop . --command nvim $file } else { - nvim $file + nvim $file } }