-
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
-
46
-
47
-
48
-
49
-
50
-
51
-
52
-
53
-
54
-
55
-
56
{ pkgs, lib, config, ... }:
let
cfg = config.features.scm;
in
{
options = {
features.scm = {
enable = lib.mkEnableOption "SCM";
};
};
config = lib.mkIf cfg.enable {
programs.git = {
enable = true;
userName = config.features.identity.name;
userEmail = config.features.identity.email;
signing =
if (config.features.identity.gpgSigningKeyId != null) then {
key = config.features.identity.gpgSigningKeyId;
signByDefault = true;
} else null;
extraConfig = {
core = {
editor = if config.programs.neovim.enable then "nvim" else "vim";
};
init = {
defaultBranch = "master";
};
};
ignores =
let
# Swap file
nvim = if config.programs.neovim.enable then [ ".*.swp" ] else [ ];
# https://github.com/github/gitignore/blob/main/Global/macOS.gitignore
darwin =
if pkgs.stdenv.isDarwin
then [
".DS_Store"
".AppleDouble"
".LSOverride"
"Icon"
]
else [ ];
in
nvim ++ darwin;
};
home.packages = [ pkgs.fossil ];
};
}