1{
2 config,
3 lib,
4 pkgs,
5 ...
6}:
7let
8 cfg = config.services.gitweb;
9
10in
11{
12
13 options.services.gitweb = {
14
15 projectroot = lib.mkOption {
16 default = "/srv/git";
17 type = lib.types.path;
18 description = ''
19 Path to git projects (bare repositories) that should be served by
20 gitweb. Must not end with a slash.
21 '';
22 };
23
24 extraConfig = lib.mkOption {
25 default = "";
26 type = lib.types.lines;
27 description = ''
28 Verbatim configuration text appended to the generated gitweb.conf file.
29 '';
30 example = ''
31 $feature{'highlight'}{'default'} = [1];
32 $feature{'ctags'}{'default'} = [1];
33 $feature{'avatar'}{'default'} = ['gravatar'];
34 '';
35 };
36
37 gitwebTheme = lib.mkOption {
38 default = false;
39 type = lib.types.bool;
40 description = ''
41 Use an alternative theme for gitweb, strongly inspired by GitHub.
42 '';
43 };
44
45 gitwebConfigFile = lib.mkOption {
46 default = pkgs.writeText "gitweb.conf" ''
47 # path to git projects (<project>.git)
48 $projectroot = "${cfg.projectroot}";
49 $highlight_bin = "${pkgs.highlight}/bin/highlight";
50 ${cfg.extraConfig}
51 '';
52 defaultText = lib.literalMD "generated config file";
53 type = lib.types.path;
54 readOnly = true;
55 internal = true;
56 };
57
58 };
59
60 meta.maintainers = [ ];
61
62}