DEVELOPMENT ENVIRONMENT

~liljamo/nix-arta

ref: cf1b2f0887950bbd12f26d31cd9f21118dfdfe7f nix-arta/roles/git.nix -rw-r--r-- 825 bytes
cf1b2f08Jonni Liljamo feat: move dns 8 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;
      };
    };
  };
}