feat: git

This commit is contained in:
punkfairie 2025-05-26 20:11:31 -07:00
parent fb29126d4c
commit 5b0774350f
Signed by: punkfairie
GPG key ID: B3C5488E9A1A7CA6
3 changed files with 12 additions and 9 deletions

View file

@ -10,6 +10,7 @@
./fuzzel.nix
./fzf.nix
./gh.nix
./git
./nemo.nix
./nh.nix
./waybar.nix

View file

@ -1,6 +1,6 @@
{
lib,
config,
lib,
...
}: let
cfg = config.marleyos.programs.git;
@ -14,6 +14,7 @@ in {
# ╚═╝ ╚═╝╚══════╝╚═╝╚═╝ ╚═╝╚══════╝╚══════╝╚══════╝
programs.git.aliases = let
has_fish = config.programs.fish.enable;
fish_fns = config.programs.fish.functions;
in {
### Staging ###
@ -84,8 +85,8 @@ in {
b = "branch";
cb = "checkout -b";
cm = lib.mkIf (fish_fns ? git_main_branch) "!git checkout $(git_main_branch)";
cd = lib.mkIf (fish_fns ? git_develop_branch) "!git checkout $(git_develop_branch)";
cm = lib.mkIf (has_fish && (fish_fns ? git_main_branch)) "!git checkout $(git_main_branch)";
cd = lib.mkIf (has_fish && (fish_fns ? git_develop_branch)) "!git checkout $(git_develop_branch)";
m = "merge";
mtl = "mergetool --no-prompt";
@ -159,9 +160,9 @@ in {
nevermind = "!git reset --hard head && git clean -df";
open = lib.mkIf (config.programs.fish.enable && (fish_fns ? git_open)) "!fish -c git_open";
open = lib.mkIf (has_fish && (fish_fns ? git_open)) "!fish -c git_open";
chash = "!git log --oneline | gum filter --height 10 | cut -d' ' -f1 | ${config.marleyos.apps.clipboard.copy-command} &>/dev/null";
chash = "!git log --oneline | gum filter --height 10 | cut -d' ' -f1 | ${config.marleycfg.apps.clipboard.copy-command} &>/dev/null";
};
};
}

View file

@ -1,10 +1,12 @@
{
lib,
config,
lib,
pkgs,
...
}: let
cfg = config.marleyos.programs.git;
inherit (config.marleycfg) my;
in {
options.marleyos.programs.git.enable = lib.mkEnableOption "git";
@ -15,7 +17,6 @@ in {
config = lib.mkIf cfg.enable {
home.packages = with pkgs; [
gum
config.marleyos.apps.clipboard.package
];
# ██████╗ ██╗████████╗
@ -28,8 +29,8 @@ in {
programs.git = {
enable = true;
userName = "punkfairie";
userEmail = "marley@punkfairie.net";
userName = my.git.name;
userEmail = my.git.email;
signing = {
signByDefault = true;