stockholm/lass/2configs/repo-sync.nix

108 lines
3.1 KiB
Nix
Raw Normal View History

2016-06-24 13:32:33 +00:00
{ config, lib, pkgs, ... }:
2016-10-20 18:54:38 +00:00
with import <stockholm/lib>;
2016-06-24 13:32:33 +00:00
let
mirror = "git@${config.networking.hostName}:";
2016-06-26 13:05:41 +00:00
defineRepo = name: announce: let
2016-06-24 13:32:33 +00:00
repo = {
public = true;
name = mkDefault "${name}";
2016-06-26 18:21:34 +00:00
cgit.desc = mkDefault "mirror for ${name}";
2016-06-26 13:05:41 +00:00
hooks = mkIf announce (mkDefault {
2016-06-24 13:32:33 +00:00
post-receive = pkgs.git-hooks.irc-announce {
nick = config.networking.hostName;
verbose = false;
channel = "#retiolum";
2016-11-11 07:47:46 +00:00
server = "ni.r";
branches = [ "newest" ];
2016-06-24 13:32:33 +00:00
};
2016-06-26 13:05:41 +00:00
});
2016-06-24 13:32:33 +00:00
};
in {
2016-06-25 11:10:13 +00:00
rules = with git; singleton {
user = with config.krebs.users; [
config.krebs.users."${config.networking.hostName}-repo-sync"
lass
lass-shodan
];
2016-06-25 11:10:13 +00:00
repo = [ repo ];
perm = push ''refs/*'' [ non-fast-forward create delete merge ];
};
repos."${name}" = repo;
};
sync-retiolum = name:
{
krebs.repo-sync.repos.${name} = {
makefu = {
origin.url = "http://cgit.gum/${name}";
mirror.url = "${mirror}${name}";
};
tv = {
2016-11-10 22:20:05 +00:00
origin.url = "http://cgit.ni.i/${name}";
2016-06-25 11:10:13 +00:00
mirror.url = "${mirror}${name}";
};
lassulus = {
origin.url = "http://cgit.prism/${name}";
mirror.url = "${mirror}${name}";
};
"@latest" = {
mirror.url = "${mirror}${name}";
mirror.ref = "heads/newest";
};
2016-06-24 13:32:33 +00:00
};
krebs.git = defineRepo name (config.networking.hostName == "prism");
2016-06-24 13:32:33 +00:00
};
2016-06-25 11:10:13 +00:00
sync-remote = name: url:
{
krebs.repo-sync.repos.${name} = {
remote = {
origin.url = url;
mirror.url = "${mirror}${name}";
};
2016-06-24 13:32:33 +00:00
};
krebs.git = defineRepo name (config.networking.hostName == "prism");
2016-06-24 13:32:33 +00:00
};
2016-06-25 11:10:13 +00:00
2016-06-26 13:05:41 +00:00
sync-remote-silent = name: url:
{
krebs.repo-sync.repos.${name} = {
remote = {
origin.url = url;
mirror.url = "${mirror}${name}";
};
};
krebs.git = defineRepo name false;
};
2016-06-24 13:32:33 +00:00
in {
krebs.repo-sync = {
enable = true;
2016-06-26 15:54:30 +00:00
unitConfig.ConditionPathExists = "!/var/run/ppp0.pid";
2016-06-24 13:32:33 +00:00
};
imports = [
2016-06-25 11:10:13 +00:00
(sync-remote "array" "https://github.com/makefu/array")
(sync-remote "email-header" "https://github.com/4z3/email-header")
(sync-remote "mycube-flask" "https://github.com/makefu/mycube-flask")
(sync-remote "reaktor-titlebot" "https://github.com/makefu/reaktor-titlebot")
(sync-remote "repo-sync" "https://github.com/makefu/repo-sync")
(sync-remote "skytraq-datalogger" "https://github.com/makefu/skytraq-datalogger")
(sync-remote "xintmap" "https://github.com/4z3/xintmap")
2016-07-21 19:28:21 +00:00
(sync-remote "realwallpaper" "https://github.com/lassulus/realwallpaper")
(sync-remote "lassulus-blog" "https://github.com/lassulus/lassulus-blog")
2016-10-27 11:16:51 +00:00
(sync-remote "painload" "https://github.com/krebscode/painload")
2016-06-26 13:05:41 +00:00
(sync-remote-silent "nixpkgs" "https://github.com/nixos/nixpkgs")
2016-06-25 11:10:13 +00:00
(sync-retiolum "go")
(sync-retiolum "much")
(sync-retiolum "newsbot-js")
(sync-retiolum "stockholm")
(sync-retiolum "wai-middleware-time")
(sync-retiolum "web-routes-wai-custom")
(sync-retiolum "xmonad-stockholm")
2016-06-24 13:32:33 +00:00
];
}