zaphyra's git: nixfiles

zaphyra's nixfiles

1 
2 
3 
4 
5 
6 
7 
8 
9 
10 
11 
12 
13 
14 
15 
16 
17 
18 
19 
20 
21 
22 
23 
24 
25 
26 
27 
28 
29 
30 
31 
32 
33 
34 
35 
36 
37 
38 
39 
40 
41 
42 
43 
44 
45 
46 
47 
48 
49 
50 
51 
52 
53 
54 
55 
56 
57 
58 
59 
60 
61 
62 
63 
64 
65 
66 
67 
68 
69 
70 
71 
72 
73 
74 
75 
76 
77 
78 
79 
80 
81 
82 
{
  lib,
  config,
  ...
}:

{

  options.zpha.programs.git.enable = lib.mkEnableOption "zaphyras git config";

  config = lib.mkIf config.zpha.programs.git.enable {
    users.users.zaphyra.maid = {
      programs = {
        git = {
          enable = true;

          ignores = [
            ".DS_Store"
            "*.swp"
          ];

          settings = {
            user = {
              name = "Katja Ramona Sophie Kwast (zaphyra)";
              email = "git@zaphyra.eu";
            };

            aliases = {
              plog = "log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(dim white)- %an%C(reset)%C(bold yellow)%d%C(reset)' --all";
              log-gpg = "log --show-signature";
              fixup = "commit --fixup";
              fuck = "reset HEAD~1";
              pfusch = "push --force-with-lease --force-if-includes";
              yikes = "commit --amend --no-edit";
            };

            init.defaultBranch = "main";

            diff.algorithm = "histogram";

            commit.verbose = true;

            rerere.enabled = true;

            merge.conflictstyle = "zdiff3";

            rebase = {
              autosquash = true;
              autostash = true;
            };

            push = {
              default = "current";
              autoSetupRemote = true;
            };

            pull.rebase = true;

            transfer.fsckobjects = true;
            fetch.fsckobjects = true;
            receive.fsckObjects = true;
          };
        };

        lazygit = {
          enable = true;
          settings = {
            disableStartupPopups = true;
            gui.nerdFontsVersion = "3";
            git.overrideGpg = true;
            os.editPreset = "micro";
          };
        };

        fish.aliases = {
          reinitgit = "rm -rf .git && git init && git add -A && git commit -m 'init'";
        };
      };
    };
  };

}