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