my system configurations ^-^
1{
2 lib,
3 osConfig,
4 config,
5 ...
6}: let
7 cfg = osConfig.settings.programs;
8in {
9 config = lib.mkIf (cfg.cli.enable
10 && cfg.categories.core.enable) {
11 programs.git = {
12 enable = true;
13 lfs.enable = true;
14
15 userName = "willow";
16 userEmail = "42willow" + "@" + "pm.me";
17
18 extraConfig = {
19 init.defaultBranch = "main";
20 credential.helper = "store";
21
22 pull = {
23 rebase = true;
24 ff = "only";
25 };
26 push = {
27 autoSetupRemote = true;
28 };
29 rebase = {
30 autoSquash = true;
31 autoStash = true;
32 };
33 merge = {
34 ff = "only";
35 };
36
37 # prevent data corruption
38 transfer.fsckObjects = true;
39 fetch.fsckObjects = true;
40 receive.fsckObjects = true;
41
42 # commit signing
43 commit.gpgsign = true;
44 gpg.format = "ssh";
45 user.signingkey = osConfig.age.secrets.gh.path;
46 gpg.ssh.allowedSignersFile = "${config.home.homeDirectory}/.ssh/allowed_signers";
47 };
48
49 aliases = {
50 co = "checkout";
51 br = "branch";
52 ci = "commit";
53 st = "status";
54 aa = "add";
55 aliases = "config --get-regexp '^alias\\.'";
56 };
57 };
58 programs.gh.enable = true;
59 };
60}