summaryrefslogtreecommitdiff
path: root/users/seth/programs/gh.nix
blob: 8b33162545f572deb568f8c71780ae6913db792c (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
{
  config,
  lib,
  ...
}:
let
  cfg = config.seth.programs.gh;
in
{
  options.seth.programs.gh = {
    enable = lib.mkEnableOption "GitHub CLI" // {
      default = config.seth.programs.git.enable;
      defaultText = "config.seth.programs.git.enable";
    };
  };

  config = lib.mkIf cfg.enable {
    programs.gh = {
      enable = true;

      settings = {
        git_protocol = "https";
        editor = "nvim";
        prompt = "enabled";
      };

      gitCredentialHelper = {
        enable = true;
        hosts = [
          "https://github.com"
          "https://github.example.com"
        ];
      };
    };
  };
}