diff --git a/home/modules/shells.nix b/home/modules/shells.nix index 87c1c9e..2e9e92e 100644 --- a/home/modules/shells.nix +++ b/home/modules/shells.nix @@ -42,27 +42,24 @@ } - def flake [command?: string] { + 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 + nix develop $root --command ...$command } } else { print "This flake doesn't have a default shell"