diff --git a/modules/terminal-life/default.nix b/modules/terminal-life/default.nix index 148d662..72313d2 100644 --- a/modules/terminal-life/default.nix +++ b/modules/terminal-life/default.nix @@ -71,6 +71,9 @@ in { inherit pkgs; inherit lib; }; + + programs.git = import ./git {}; + programs.direnv = import ./direnv {}; }; }; } diff --git a/modules/terminal-life/direnv/default.nix b/modules/terminal-life/direnv/default.nix new file mode 100644 index 0000000..0143c83 --- /dev/null +++ b/modules/terminal-life/direnv/default.nix @@ -0,0 +1,7 @@ +{ ... }: +{ + enable = true; + nix-direnv = { + enable = true; + }; +} diff --git a/modules/terminal-life/git/default.nix b/modules/terminal-life/git/default.nix new file mode 100644 index 0000000..6533d04 --- /dev/null +++ b/modules/terminal-life/git/default.nix @@ -0,0 +1,41 @@ +{ ... }: +{ + enable = true; + + extraConfig = { + pull.rebase = false; + }; + + aliases = { + a = "add -p"; + co = "checkout"; + cob = "checkout -b"; + f = "fetch -p"; + c = "commit"; + p = "push"; + ba = "branch -a"; + bd = "branch -d"; + bD = "branch -D"; + d = "diff"; + dc = "diff --cached"; + ds = "diff --staged"; + r = "restore"; + rs = "restore --staged"; + st = "status -sb"; + + # reset + soft = "reset --soft"; + hard = "reset --hard"; + s1ft = "soft HEAD~1"; + h1rd = "hard HEAD~1"; + + # logging + lg = "log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit"; + plog = "log --graph --pretty='format:%C(red)%d%C(reset) %C(yellow)%h%C(reset) %ar %C(green)%aN%C(reset) %s'"; + tlog = "log --stat --since='1 Day Ago' --graph --pretty=oneline --abbrev-commit --date=relative"; + rank = "shortlog -sn --no-merges"; + + # delete merged branches + bdm = "!git branch --merged | grep -v '*' | xargs -n 1 git branch -d"; + }; +} diff --git a/users/profiles/direnv/default.nix b/users/profiles/direnv/default.nix deleted file mode 100644 index 67ff211..0000000 --- a/users/profiles/direnv/default.nix +++ /dev/null @@ -1,8 +0,0 @@ -{ - programs.direnv = { - enable = true; - nix-direnv = { - enable = true; - }; - }; -} diff --git a/users/profiles/git/default.nix b/users/profiles/git/default.nix deleted file mode 100644 index f827f5b..0000000 --- a/users/profiles/git/default.nix +++ /dev/null @@ -1,42 +0,0 @@ -{ - programs.git = { - enable = true; - - extraConfig = { - pull.rebase = false; - }; - - aliases = { - a = "add -p"; - co = "checkout"; - cob = "checkout -b"; - f = "fetch -p"; - c = "commit"; - p = "push"; - ba = "branch -a"; - bd = "branch -d"; - bD = "branch -D"; - d = "diff"; - dc = "diff --cached"; - ds = "diff --staged"; - r = "restore"; - rs = "restore --staged"; - st = "status -sb"; - - # reset - soft = "reset --soft"; - hard = "reset --hard"; - s1ft = "soft HEAD~1"; - h1rd = "hard HEAD~1"; - - # logging - lg = "log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit"; - plog = "log --graph --pretty='format:%C(red)%d%C(reset) %C(yellow)%h%C(reset) %ar %C(green)%aN%C(reset) %s'"; - tlog = "log --stat --since='1 Day Ago' --graph --pretty=oneline --abbrev-commit --date=relative"; - rank = "shortlog -sn --no-merges"; - - # delete merged branches - bdm = "!git branch --merged | grep -v '*' | xargs -n 1 git branch -d"; - }; - }; -}