From ea5ddd66ed609d01fc393dbde5f5c77dae3a0cd0 Mon Sep 17 00:00:00 2001 From: maxstrb Date: Wed, 1 Oct 2025 22:44:33 +0200 Subject: [PATCH] non important commit --- home/modules/shells.nix | 31 +++++++++++++++++-------------- 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/home/modules/shells.nix b/home/modules/shells.nix index d7f20bd..ec02b74 100644 --- a/home/modules/shells.nix +++ b/home/modules/shells.nix @@ -46,24 +46,27 @@ pwd } else { $user_file - } | path expand + } 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 - print $file - return - } - cd $root - nix develop . --command nvim $file - print $file - } else { + if $git_result.exit_code != 0 { nvim $file - print $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 + } + + if ($user_file | is-empty) { + nix develop $root --command nvim + } else { + nix develop $root --command nvim $file } }