The ancient `//web/cgit-taz` path stems from the time I had code.tazj.in serving my initial version of the depot. I've been meaning to clean this up for forever, so here we go. Note that this leaves the git-serving module in a strange state where it only deals with josh. I'll rename it accordingly. Change-Id: I47ed1e9d90958299b5440a18a1b9075274754e33 Reviewed-on: https://cl.tvl.fyi/c/depot/+/5294 Tested-by: BuildkiteCI Autosubmit: tazjin <tazjin@tvl.su> Reviewed-by: sterni <sternenseemann@systemli.org>
33 lines
937 B
Nix
33 lines
937 B
Nix
# Configures the public josh instance for serving the depot.
|
|
{ config, depot, lib, pkgs, ... }:
|
|
|
|
let
|
|
cfg = config.services.depot.git-serving;
|
|
in
|
|
{
|
|
options.services.depot.git-serving = with lib; {
|
|
enable = mkEnableOption "Enable cgit & josh configuration";
|
|
|
|
joshPort = mkOption {
|
|
description = "Port on which josh should listen";
|
|
type = types.int;
|
|
default = 5674;
|
|
};
|
|
};
|
|
|
|
config = lib.mkIf cfg.enable {
|
|
# Run josh for the depot.
|
|
systemd.services.josh = {
|
|
description = "josh - partial cloning of monorepos";
|
|
wantedBy = [ "multi-user.target" ];
|
|
path = [ pkgs.git pkgs.bash ];
|
|
|
|
serviceConfig = {
|
|
DynamicUser = true;
|
|
StateDirectory = "josh";
|
|
Restart = "always";
|
|
ExecStart = "${depot.third_party.josh}/bin/josh-proxy --no-background --local /var/lib/josh --port ${toString cfg.joshPort} --remote https://cl.tvl.fyi/";
|
|
};
|
|
};
|
|
};
|
|
}
|