DEVELOPMENT ENVIRONMENT

~liljamo/nix-arta

ref: 0e846ab2fa68c6ba9015c2a5af96aff0c0ea8df9 nix-arta/roles/git.nix -rw-r--r-- 825 bytes
0e846ab2Jonni Liljamo feat(systems/hosts/cloud): mess with nextcloud opcache settings 21 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;
      };
    };
  };
}