From 30eccf25e0f878cc6de6a44aa798cd0f11ce5491 Mon Sep 17 00:00:00 2001 From: RGBCube Date: Wed, 7 Feb 2024 09:59:02 +0300 Subject: [PATCH] Add gsr alias --- modules/git.nix | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/modules/git.nix b/modules/git.nix index cef2c13..f57cdb4 100644 --- a/modules/git.nix +++ b/modules/git.nix @@ -53,6 +53,19 @@ homeConfiguration { gst = "git status"; }; + programs.nushell.configFile.text = lib.mkAfter '' + # Sets the remote origin to the specified user and repository on my git instance + def gsr [user_and_repo: string] { + let user_and_repo = if ($user_and_repo | str index-of "/") != -1 { + $user_and_repo + } else { + "RGBCube/" + $user_and_repo + } + + git remote add origin ("https://git.rgbcu.be/" + $user_and_repo) + } + ''; + programs.git = enabled { package = pkgs.gitFull;