From 7adf05999a11c4be6031f908fd9f1fec24bedf90 Mon Sep 17 00:00:00 2001 From: lassulus Date: Fri, 24 Jun 2016 15:32:33 +0200 Subject: l 2: add repo-sync --- lass/2configs/repo-sync.nix | 68 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 lass/2configs/repo-sync.nix (limited to 'lass/2configs/repo-sync.nix') diff --git a/lass/2configs/repo-sync.nix b/lass/2configs/repo-sync.nix new file mode 100644 index 00000000..bb5123a0 --- /dev/null +++ b/lass/2configs/repo-sync.nix @@ -0,0 +1,68 @@ +{ config, lib, pkgs, ... }: + +with config.krebs.lib; + +let + mirror = "git@${config.networking.hostName}:"; + + sync = name: let + repo = { + public = true; + name = mkDefault "${name}"; + cgit.desc = mkDefault "mirror for all ${name} branches"; + hooks = mkDefault { + post-receive = pkgs.git-hooks.irc-announce { + nick = config.networking.hostName; + verbose = false; + channel = "#retiolum"; + server = "cd.retiolum"; + }; + }; + }; + in { + krebs.repo-sync.repos.${name} = { + makefu = { + origin.url = "http://cgit.gum/${name}"; + mirror.url = "${mirror}${name}"; + }; + tv = { + origin.url = "http://cgit.cd/${name}"; + mirror.url = "${mirror}${name}"; + }; + lassulus = { + origin.url = "http://cgit.prism/${name}"; + mirror.url = "${mirror}${name}"; + }; + "@latest" = { + mirror.url = "${mirror}${name}"; + mirror.ref = "heads/newest"; + }; + }; + krebs.git = { + rules = with git; singleton { + user = [ config.krebs.users."${config.networking.hostName}-repo-sync" ]; + repo = [ repo ]; + perm = push ''refs/*'' [ non-fast-forward create delete merge ]; + }; + repos."${name}" = repo; + }; + }; + +in { + krebs.repo-sync = { + enable = true; + privateKeyFile = toString ; + }; + imports = [ + (sync "stockholm") + (sync "realwallpaper") + (sync "xmonad-stockholm") + (sync "newsbot-js") + (sync "go") + (sync "wai-middleware-time") + (sync "web-routes-wai-custom") + (sync "much") + (sync "painload") + ]; +} + -- cgit v1.2.3