diff options
author | tv <tv@shackspace.de> | 2015-06-22 19:19:32 +0200 |
---|---|---|
committer | tv <tv@shackspace.de> | 2015-06-22 19:19:32 +0200 |
commit | ff7178be0090f31e12c65d6158c558bf1d9d7f14 (patch) | |
tree | ca44202474824f9ad9f7f8ad6c34a2ec030bad32 /modules/tv/git/options.nix | |
parent | 964855f30bcb36869f24cb8474b9a0c44f58a736 (diff) |
tv git: split module into options and config
Diffstat (limited to 'modules/tv/git/options.nix')
-rw-r--r-- | modules/tv/git/options.nix | 93 |
1 files changed, 93 insertions, 0 deletions
diff --git a/modules/tv/git/options.nix b/modules/tv/git/options.nix new file mode 100644 index 000000000..c251d7d4c --- /dev/null +++ b/modules/tv/git/options.nix @@ -0,0 +1,93 @@ +{ lib, ... }: + +let + inherit (lib) literalExample mkOption types; +in + +{ + enable = mkOption { + type = types.bool; + default = false; + description = "Enable Git repository hosting."; + }; + cgit = mkOption { + type = types.bool; + default = true; + description = "Enable cgit."; # TODO better desc; talk about nginx + }; + dataDir = mkOption { + type = types.str; + default = "/var/lib/git"; + description = "Directory used to store repositories."; + }; + etcDir = mkOption { + type = types.str; + default = "/etc/git"; + }; + rules = mkOption { + type = types.unspecified; + }; + repos = mkOption { + type = types.attrsOf (types.submodule ({ + options = { + desc = mkOption { + type = types.nullOr types.str; + default = null; + description = '' + Repository description. + ''; + }; + section = mkOption { + type = types.nullOr types.str; + default = null; + description = '' + Repository section. + ''; + }; + name = mkOption { + type = types.str; + description = '' + Repository name. + ''; + }; + hooks = mkOption { + type = types.attrsOf types.str; + description = '' + Repository-specific hooks. + ''; + }; + public = mkOption { + type = types.bool; + default = false; + description = '' + Allow everybody to read the repository via HTTP if cgit enabled. + ''; + # TODO allow every configured user to fetch the repository via SSH. + }; + }; + })); + + default = {}; + + example = literalExample '' + { + testing = { + name = "testing"; + hooks.post-update = ''' + #! /bin/sh + set -euf + echo post-update hook: $* >&2 + '''; + }; + testing2 = { name = "testing2"; }; + } + ''; + + description = '' + Repositories. + ''; + }; + users = mkOption { + type = types.unspecified; + }; +} |