summaryrefslogtreecommitdiff
path: root/users/seth/programs/jj.nix
blob: 2acd2527636f6889f2d00f053718a9ee4df95db3 (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
40
41
42
43
44
45
{
  config,
  lib,
  ...
}:
let
  cfg = config.seth.programs.jujutsu;
in
{
  options.seth.programs.jujutsu = {
    enable = lib.mkEnableOption "jujutsu configuration settings" // {
      default = config.seth.enable;
      defaultText = lib.literalExpression "config.seth.enable";
    };
  };

  # TODO: Configure
  config = lib.mkIf cfg.enable {
    assertions = [
      {
        assertion = cfg.enable -> (config.seth.programs.git.enable && config.seth.programs.gh.enable);
        message = "`seth.programs.git` and `seth.programs.gh` are required to use `seth.programs.jujutsu`";
      }
    ];

    programs = {
      jujutsu = {
        enable = true;

        settings = {
          user = {
            name = "seth";
            email = "[email protected]";
          };

          signing = {
            sign-all = true;
            backend = "gpg";
            key = "D31BD0D494BBEE86";
          };
        };
      };
    };
  };
}