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

145 lines
4.2 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}";
2017-03-16 14:09:39 +00:00
cgit.section = mkDefault "mirror";
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;
2017-10-01 12:21:34 +00:00
channel = "#xxx";
refs = [
"refs/heads/newest"
];
2017-10-01 11:35:30 +00:00
server = "irc.r";
verbose = false;
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 {
2017-12-05 14:15:21 +00:00
rules = with git; [
{
user = with config.krebs.users; [
config.krebs.users."${config.networking.hostName}-repo-sync"
lass
2018-06-27 21:47:55 +00:00
lass-mors
2017-12-05 14:15:21 +00:00
lass-shodan
];
repo = [ repo ];
perm = push ''refs/*'' [ non-fast-forward create delete merge ];
}
{
user = attrValues config.krebs.users;
repo = [ repo ];
perm = fetch;
}
];
2016-06-25 11:10:13 +00:00
repos."${name}" = repo;
};
sync-retiolum = name:
{
krebs.repo-sync.repos.${name} = {
2017-03-07 23:49:13 +00:00
branches = {
makefu = {
origin.url = "http://cgit.gum/${name}";
mirror.url = "${mirror}${name}";
};
tv = {
origin.url = "http://cgit.ni.r/${name}";
mirror.url = "${mirror}${name}";
};
nin = {
origin.url = "http://cgit.onondaga.r/${name}";
mirror.url = "${mirror}${name}";
};
lassulus = {
origin.url = "http://cgit.lassul.us/${name}";
mirror.url = "${mirror}${name}";
};
2018-04-05 15:38:31 +00:00
makefu-staging = {
origin.url = "http://cgit.gum/${name}";
origin.ref = "heads/staging";
mirror.url = "${mirror}${name}";
};
tv-staging = {
origin.url = "http://cgit.ni.r/${name}";
origin.ref = "heads/staging";
mirror.url = "${mirror}${name}";
};
nin-staging = {
origin.url = "http://cgit.onondaga.r/${name}";
origin.ref = "heads/staging";
mirror.url = "${mirror}${name}";
};
2016-06-25 11:10:13 +00:00
};
2017-03-07 23:49:13 +00:00
latest = {
url = "${mirror}${name}";
ref = "heads/newest";
2016-06-25 11:10:13 +00:00
};
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} = {
2017-03-07 23:49:13 +00:00
branches = {
remote = {
origin.url = url;
mirror.url = "${mirror}${name}";
};
2016-06-25 11:10:13 +00:00
};
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} = {
2017-03-07 23:49:13 +00:00
branches = {
remote = {
origin.url = url;
mirror.url = "${mirror}${name}";
};
2016-06-26 13:05:41 +00:00
};
};
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")
2018-06-12 16:43:12 +00:00
(sync-remote "painload" "https://github.com/krebs/painload")
(sync-remote "Reaktor" "https://github.com/krebs/Reaktor")
2017-04-27 16:58:50 +00:00
(sync-remote "nixos-wiki" "https://github.com/Mic92/nixos-wiki.wiki.git")
2016-06-25 11:10:13 +00:00
(sync-retiolum "go")
(sync-retiolum "much")
(sync-retiolum "newsbot-js")
2017-02-06 14:08:49 +00:00
(sync-retiolum "populate")
2016-06-25 11:10:13 +00:00
(sync-retiolum "stockholm")
(sync-retiolum "wai-middleware-time")
(sync-retiolum "xmonad-stockholm")
2018-06-27 21:48:35 +00:00
(sync-retiolum "nix-writers")
2016-06-24 13:32:33 +00:00
];
}