Home

gen @main - refs - log -
-
https://git.jolheiser.com/gen.git
Generate Go flags and Nix module
gen / testdata / ugit.nix.golden
- raw -
  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
# Code generated by gen from ugit.cue; DO NOT EDIT.
{ lib, profileLink }:
let
  inherit (lib) mkOption types;
in
{
  repo-dir = mkOption {
    type = types.nonEmptyStr;
    default = "/var/lib/ugit/repos";
    description = "Path to directory containing repositories";
  };

  ssh = {
    enable = mkOption {
      type = types.bool;
      default = true;
      description = "Enable SSH server";
    };
    authorized-keys = mkOption {
      type = types.nonEmptyStr;
      default = "/var/lib/ugit/authorized_keys";
      description = "Path to authorized_keys";
    };
    clone-url = mkOption {
      type = types.strMatching "[a-z][a-z0-9+.-]*://.*";
      default = "ssh://localhost:8448";
      description = "SSH clone URL base";
    };
    port = mkOption {
      type = types.port;
      default = 8448;
      description = "SSH port";
    };
    host-key = mkOption {
      type = types.nonEmptyStr;
      default = "/var/lib/ugit/ugit_ed25519";
      description = "SSH host key (created if it doesn't exist)";
    };
  };

  http = {
    enable = mkOption {
      type = types.bool;
      default = true;
      description = "Enable HTTP server";
    };
    clone-url = mkOption {
      type = types.strMatching "[a-z][a-z0-9+.-]*://.*";
      default = "http://localhost:8449";
      description = "HTTP clone URL base";
    };
    port = mkOption {
      type = types.port;
      default = 8449;
      description = "HTTP port";
    };
  };

  meta = {
    title = mkOption {
      type = types.str;
      default = "ugit";
      description = "App title";
    };
    description = mkOption {
      type = types.str;
      default = "Minimal git server";
      description = "App description";
    };
  };

  profile = {
    username = mkOption {
      type = types.str;
      default = "";
      description = "Username for index page";
    };
    email = mkOption {
      type = types.str;
      default = "";
      description = "Email for index page";
    };
    links = mkOption {
      type = types.listOf profileLink.type;
      default = [ ];
      apply = map profileLink.apply;
      description = "Link(s) for index page";
    };
  };

  log = {
    level = mkOption {
      type = types.enum [ "debug" "info" "warn" "warning" "error" ];
      default = "error";
      description = "Logging level";
    };
    json = mkOption {
      type = types.bool;
      default = false;
      description = "Print logs in JSON(L) format";
    };
  };

  show-private = mkOption {
    type = types.bool;
    default = false;
    description = "Show private repos in web interface";
  };
}