diff options
author | gnidorah <gnidorah@users.noreply.github.com> | 2018-03-29 16:42:49 +0300 |
---|---|---|
committer | gnidorah <gnidorah@users.noreply.github.com> | 2018-03-29 16:45:32 +0300 |
commit | 2821d3fed74a209c8771402ce8058fd4188357ad (patch) | |
tree | 9e14502d911314ed0df2e4e90f8e2fecbc21a495 /nixos/modules/services/misc/gitweb.nix | |
parent | 69a0c9721e4cd66739971d499a67988f8412e5d7 (diff) | |
download | nixlib-2821d3fed74a209c8771402ce8058fd4188357ad.tar nixlib-2821d3fed74a209c8771402ce8058fd4188357ad.tar.gz nixlib-2821d3fed74a209c8771402ce8058fd4188357ad.tar.bz2 nixlib-2821d3fed74a209c8771402ce8058fd4188357ad.tar.lz nixlib-2821d3fed74a209c8771402ce8058fd4188357ad.tar.xz nixlib-2821d3fed74a209c8771402ce8058fd4188357ad.tar.zst nixlib-2821d3fed74a209c8771402ce8058fd4188357ad.zip |
gitweb: use common options
Diffstat (limited to 'nixos/modules/services/misc/gitweb.nix')
-rw-r--r-- | nixos/modules/services/misc/gitweb.nix | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/nixos/modules/services/misc/gitweb.nix b/nixos/modules/services/misc/gitweb.nix new file mode 100644 index 000000000000..8e4d85a1e15f --- /dev/null +++ b/nixos/modules/services/misc/gitweb.nix @@ -0,0 +1,50 @@ +{ 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]; + ''; + }; + + gitwebConfigFile = mkOption { + default = pkgs.writeText "gitweb.conf" '' + # path to git projects (<project>.git) + $projectroot = "${cfg.projectroot}"; + $highlight_bin = "${pkgs.highlight}/bin/highlight"; + ${cfg.extraConfig} + ''; + type = types.path; + readOnly = true; + internal = true; + }; + + }; + + meta.maintainers = with maintainers; [ gnidorah ]; + +} |