summaryrefslogtreecommitdiff
path: root/hm/conf/git.nix
blob: 15a7804be316ea0eaece08ceca6634b848777ba7 (plain)
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
{
  config,
  lib,
  ...
}:
let
  cfg = config.hm.conf.git;
in
{
  options.hm.conf.git.enable = lib.mkEnableOption "enables git vcs";
  config = lib.mkIf cfg.enable {
    programs.git = {
      enable = true;
      lfs.enable = true;
      signing = {
        format = "ssh";
        key = "~/.ssh/main_id_ed25519.pub";
        signByDefault = true;
      };
      settings = {
        user = {
          name = "adikro";
          email = "adikro@disroot.org";
        };
        gpg.ssh.allowedSignersFile = "~/.ssh/allowed_signers";
        init.defaultBranch = "main";
        push.autoSetupRemote = true;
        pull.rebase = true;
      };
      ignores = [
        "result"
        ".direnv/"
      ];
    };
    home.file.".ssh/allowed_signers".text = ''
      adikro@disroot.org ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIC610CJfgc3yII7MpLVqzEzQGa8Tsm+dih+CTXHXTnv4
    '';
  };
}