diff --git a/home/modules/create-project/create-project.nix b/home/modules/create-project/create-project.nix index 24a4292..eabe129 100644 --- a/home/modules/create-project/create-project.nix +++ b/home/modules/create-project/create-project.nix @@ -47,18 +47,10 @@ } if $local { + print "You are all done" exit 0 } - ssh "admin@silvers.fun" $"sudo -S -u git git init --bare /var/lib/git-server/($name).git" - print $"Repository ($name) created successfully!" - - git init - git add . - git commit -m "Project setup" - git remote add origin $"git@silvers.fun:($name).git" - git push origin main - print "You are all done" exit 0 diff --git a/home/modules/shells.nix b/home/modules/shells.nix index 51c90a4..92f6430 100644 --- a/home/modules/shells.nix +++ b/home/modules/shells.nix @@ -57,20 +57,16 @@ } def edit [file: path] { - match ($file | path parse | get extension) { - "rs" => { - flake rust -c $"nvim ($file)" - } - "zig" => { - flake zig -c $"nvim ($file)" - } - "c" | "cpp" => { - flake c -c $"nvim ($file)" - } - "cs" => { - flake c-sharp -c $"nvim ($file)" - } - _ => {nvim $file} + let result = do { + git rev-parse --show-toplevel + } | complete + + if $result.exit_code == 0 { + let root = $result.stdout | str trim + cd root + nix develop . --command bash -c $"nvim ($file)" + } else { + nvim file } }