DEVELOPMENT ENVIRONMENT

~liljamo/nix-arta

ref: b175d4accd75af1c6d9b0403d921deebab342cd1 nix-arta/roles/git.nix -rw-r--r-- 825 bytes
b175d4acJonni Liljamo feat: move metrics 11 days ago
                                                                                
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
{
  config,
  lib,
  pkgs,
  ...
}: let
  cfg = config.roles.git;
in {
  options.roles.git = {
    enable = lib.mkEnableOption "enable git";
    email = lib.mkOption {
      type = lib.types.str;
    };
    name = lib.mkOption {
      type = lib.types.str;
    };
    gitExtraConfig = lib.mkOption {
      type = lib.types.lines;
      default = {};
    };
    enableLazygit = lib.mkEnableOption "enable lazygit";
  };

  config = {
    programs.lazygit = lib.mkIf cfg.enableLazygit {
      enable = true;
      settings = {
        disableStartupPopups = true;
      };
    };

    hm = {
      programs.git = lib.mkIf cfg.enable {
        enable = true;
        package = pkgs.gitAndTools.gitFull;
        userEmail = cfg.email;
        userName = cfg.name;
        extraConfig = cfg.gitExtraConfig;
      };
    };
  };
}