2018-03-29 13:42:49 +00:00
|
|
|
{ config, lib, pkgs, ... }:
|
|
|
|
let
|
|
|
|
cfg = config.services.gitweb;
|
|
|
|
|
|
|
|
in
|
|
|
|
{
|
|
|
|
|
|
|
|
options.services.gitweb = {
|
|
|
|
|
2024-08-24 20:05:44 +00:00
|
|
|
projectroot = lib.mkOption {
|
2018-03-29 13:42:49 +00:00
|
|
|
default = "/srv/git";
|
2024-08-24 20:05:44 +00:00
|
|
|
type = lib.types.path;
|
2024-04-13 12:54:15 +00:00
|
|
|
description = ''
|
2018-03-29 13:42:49 +00:00
|
|
|
Path to git projects (bare repositories) that should be served by
|
|
|
|
gitweb. Must not end with a slash.
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
2024-08-24 20:05:44 +00:00
|
|
|
extraConfig = lib.mkOption {
|
2018-03-29 13:42:49 +00:00
|
|
|
default = "";
|
2024-08-24 20:05:44 +00:00
|
|
|
type = lib.types.lines;
|
2024-04-13 12:54:15 +00:00
|
|
|
description = ''
|
2018-03-29 13:42:49 +00:00
|
|
|
Verbatim configuration text appended to the generated gitweb.conf file.
|
|
|
|
'';
|
|
|
|
example = ''
|
|
|
|
$feature{'highlight'}{'default'} = [1];
|
|
|
|
$feature{'ctags'}{'default'} = [1];
|
2018-04-06 19:36:03 +00:00
|
|
|
$feature{'avatar'}{'default'} = ['gravatar'];
|
2018-03-29 13:42:49 +00:00
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
2024-08-24 20:05:44 +00:00
|
|
|
gitwebTheme = lib.mkOption {
|
2018-04-17 17:06:44 +00:00
|
|
|
default = false;
|
2024-08-24 20:05:44 +00:00
|
|
|
type = lib.types.bool;
|
2024-04-13 12:54:15 +00:00
|
|
|
description = ''
|
2018-04-17 17:06:44 +00:00
|
|
|
Use an alternative theme for gitweb, strongly inspired by GitHub.
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
2024-08-24 20:05:44 +00:00
|
|
|
gitwebConfigFile = lib.mkOption {
|
2018-03-29 13:42:49 +00:00
|
|
|
default = pkgs.writeText "gitweb.conf" ''
|
|
|
|
# path to git projects (<project>.git)
|
|
|
|
$projectroot = "${cfg.projectroot}";
|
|
|
|
$highlight_bin = "${pkgs.highlight}/bin/highlight";
|
|
|
|
${cfg.extraConfig}
|
|
|
|
'';
|
2024-08-24 20:05:44 +00:00
|
|
|
defaultText = lib.literalMD "generated config file";
|
|
|
|
type = lib.types.path;
|
2018-03-29 13:42:49 +00:00
|
|
|
readOnly = true;
|
|
|
|
internal = true;
|
|
|
|
};
|
|
|
|
|
|
|
|
};
|
|
|
|
|
2024-07-28 14:44:11 +00:00
|
|
|
meta.maintainers = [ ];
|
2018-03-29 13:42:49 +00:00
|
|
|
|
|
|
|
}
|