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 From 6ebd5f13e6ea9076eb917d06e19a2b216f75ca01 Mon Sep 17 00:00:00 2001 From: lassulus Date: Sat, 25 Jun 2016 13:10:13 +0200 Subject: l 2 repo-sync: fetch some remote repos --- lass/2configs/repo-sync.nix | 93 +++++++++++++++++++++++++++++---------------- 1 file changed, 60 insertions(+), 33 deletions(-) (limited to 'lass/2configs/repo-sync.nix') diff --git a/lass/2configs/repo-sync.nix b/lass/2configs/repo-sync.nix index bb5123a0..9b1e8053 100644 --- a/lass/2configs/repo-sync.nix +++ b/lass/2configs/repo-sync.nix @@ -5,7 +5,7 @@ with config.krebs.lib; let mirror = "git@${config.networking.hostName}:"; - sync = name: let + defineRepo = name: let repo = { public = true; name = mkDefault "${name}"; @@ -20,33 +20,52 @@ let }; }; 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"; + 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; + }; + + sync-retiolum = name: + { + 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 = defineRepo name; }; - 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 ]; + + sync-remote = name: url: + { + krebs.repo-sync.repos.${name} = { + remote = { + origin.url = url; + mirror.url = "${mirror}${name}"; + }; + "@latest" = { + mirror.url = "${mirror}${name}"; + mirror.ref = "heads/newest"; + }; }; - repos."${name}" = repo; + krebs.git = defineRepo name; }; - }; + in { krebs.repo-sync = { @@ -54,15 +73,23 @@ in { 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") + (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 "nixpkgs" "https://github.com/nixos/nixpkgs") + (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") + (sync-retiolum "go") + (sync-retiolum "much") + (sync-retiolum "newsbot-js") + (sync-retiolum "painload") + (sync-retiolum "realwallpaper") + (sync-retiolum "stockholm") + (sync-retiolum "wai-middleware-time") + (sync-retiolum "web-routes-wai-custom") + (sync-retiolum "xmonad-stockholm") ]; } -- cgit v1.2.3 From 9fd537b4d6fe0356324676f38a195bc59c01b0bd Mon Sep 17 00:00:00 2001 From: lassulus Date: Sat, 25 Jun 2016 18:39:54 +0200 Subject: l 2 repo-sync: don't merge remote repos --- lass/2configs/repo-sync.nix | 4 ---- 1 file changed, 4 deletions(-) (limited to 'lass/2configs/repo-sync.nix') diff --git a/lass/2configs/repo-sync.nix b/lass/2configs/repo-sync.nix index 9b1e8053..9a42647e 100644 --- a/lass/2configs/repo-sync.nix +++ b/lass/2configs/repo-sync.nix @@ -58,10 +58,6 @@ let origin.url = url; mirror.url = "${mirror}${name}"; }; - "@latest" = { - mirror.url = "${mirror}${name}"; - mirror.ref = "heads/newest"; - }; }; krebs.git = defineRepo name; }; -- cgit v1.2.3 From 5608bc02d7728416c7ea083b10cdac91e34f44c5 Mon Sep 17 00:00:00 2001 From: lassulus Date: Sun, 26 Jun 2016 15:05:41 +0200 Subject: l 2 repo-sync: silence nixpkgs --- lass/2configs/repo-sync.nix | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) (limited to 'lass/2configs/repo-sync.nix') diff --git a/lass/2configs/repo-sync.nix b/lass/2configs/repo-sync.nix index 9a42647e..aaeae7b7 100644 --- a/lass/2configs/repo-sync.nix +++ b/lass/2configs/repo-sync.nix @@ -5,19 +5,19 @@ with config.krebs.lib; let mirror = "git@${config.networking.hostName}:"; - defineRepo = name: let + defineRepo = name: announce: let repo = { public = true; name = mkDefault "${name}"; cgit.desc = mkDefault "mirror for all ${name} branches"; - hooks = mkDefault { + hooks = mkIf announce (mkDefault { post-receive = pkgs.git-hooks.irc-announce { nick = config.networking.hostName; verbose = false; channel = "#retiolum"; server = "cd.retiolum"; }; - }; + }); }; in { rules = with git; singleton { @@ -48,7 +48,7 @@ let mirror.ref = "heads/newest"; }; }; - krebs.git = defineRepo name; + krebs.git = defineRepo name true; }; sync-remote = name: url: @@ -59,9 +59,19 @@ let mirror.url = "${mirror}${name}"; }; }; - krebs.git = defineRepo name; + krebs.git = defineRepo name true; }; + sync-remote-silent = name: url: + { + krebs.repo-sync.repos.${name} = { + remote = { + origin.url = url; + mirror.url = "${mirror}${name}"; + }; + }; + krebs.git = defineRepo name false; + }; in { krebs.repo-sync = { @@ -72,11 +82,11 @@ in { (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 "nixpkgs" "https://github.com/nixos/nixpkgs") (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") + (sync-remote-silent "nixpkgs" "https://github.com/nixos/nixpkgs") (sync-retiolum "go") (sync-retiolum "much") (sync-retiolum "newsbot-js") -- cgit v1.2.3 From 8fa2b200aa8ba86fb316a6c538c45877ef510331 Mon Sep 17 00:00:00 2001 From: lassulus Date: Sun, 26 Jun 2016 17:54:30 +0200 Subject: l 2 repo-sync: don't sync on umts --- lass/2configs/repo-sync.nix | 1 + 1 file changed, 1 insertion(+) (limited to 'lass/2configs/repo-sync.nix') diff --git a/lass/2configs/repo-sync.nix b/lass/2configs/repo-sync.nix index aaeae7b7..1d947f8a 100644 --- a/lass/2configs/repo-sync.nix +++ b/lass/2configs/repo-sync.nix @@ -77,6 +77,7 @@ in { krebs.repo-sync = { enable = true; privateKeyFile = toString ; + unitConfig.ConditionPathExists = "!/var/run/ppp0.pid"; }; imports = [ (sync-remote "array" "https://github.com/makefu/array") -- cgit v1.2.3 From f7820d6f3a4812eddda0c8a6536d525a4206024c Mon Sep 17 00:00:00 2001 From: lassulus Date: Sun, 26 Jun 2016 17:54:53 +0200 Subject: l 2 repo-sync: irc-announce only for prism --- lass/2configs/repo-sync.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lass/2configs/repo-sync.nix') diff --git a/lass/2configs/repo-sync.nix b/lass/2configs/repo-sync.nix index 1d947f8a..821e3baf 100644 --- a/lass/2configs/repo-sync.nix +++ b/lass/2configs/repo-sync.nix @@ -48,7 +48,7 @@ let mirror.ref = "heads/newest"; }; }; - krebs.git = defineRepo name true; + krebs.git = defineRepo name (config.networking.hostName == "prism"); }; sync-remote = name: url: @@ -59,7 +59,7 @@ let mirror.url = "${mirror}${name}"; }; }; - krebs.git = defineRepo name true; + krebs.git = defineRepo name (config.networking.hostName == "prism"); }; sync-remote-silent = name: url: -- cgit v1.2.3 From de56a05985a1eda27030b9970473ed8481cfbdbb Mon Sep 17 00:00:00 2001 From: lassulus Date: Sun, 26 Jun 2016 18:24:08 +0200 Subject: l 2 repo-sync: remove broken privateKey definition --- lass/2configs/repo-sync.nix | 1 - 1 file changed, 1 deletion(-) (limited to 'lass/2configs/repo-sync.nix') diff --git a/lass/2configs/repo-sync.nix b/lass/2configs/repo-sync.nix index 821e3baf..daf55bb9 100644 --- a/lass/2configs/repo-sync.nix +++ b/lass/2configs/repo-sync.nix @@ -76,7 +76,6 @@ let in { krebs.repo-sync = { enable = true; - privateKeyFile = toString ; unitConfig.ConditionPathExists = "!/var/run/ppp0.pid"; }; imports = [ -- cgit v1.2.3 From b1b929c67dc48ecf036259bca0de8c2661ccce8c Mon Sep 17 00:00:00 2001 From: lassulus Date: Sun, 26 Jun 2016 19:22:19 +0200 Subject: l 2: only announce branches master & newest --- lass/2configs/repo-sync.nix | 1 + 1 file changed, 1 insertion(+) (limited to 'lass/2configs/repo-sync.nix') diff --git a/lass/2configs/repo-sync.nix b/lass/2configs/repo-sync.nix index daf55bb9..d5fa6766 100644 --- a/lass/2configs/repo-sync.nix +++ b/lass/2configs/repo-sync.nix @@ -16,6 +16,7 @@ let verbose = false; channel = "#retiolum"; server = "cd.retiolum"; + branches = [ "newest" ]; }; }); }; -- cgit v1.2.3 From 90690ab652f5d07d9ea42f88849f931d90d542a3 Mon Sep 17 00:00:00 2001 From: lassulus Date: Sun, 26 Jun 2016 20:21:34 +0200 Subject: l 2 repo-sync: fix description --- lass/2configs/repo-sync.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lass/2configs/repo-sync.nix') diff --git a/lass/2configs/repo-sync.nix b/lass/2configs/repo-sync.nix index d5fa6766..afe2abb6 100644 --- a/lass/2configs/repo-sync.nix +++ b/lass/2configs/repo-sync.nix @@ -9,7 +9,7 @@ let repo = { public = true; name = mkDefault "${name}"; - cgit.desc = mkDefault "mirror for all ${name} branches"; + cgit.desc = mkDefault "mirror for ${name}"; hooks = mkIf announce (mkDefault { post-receive = pkgs.git-hooks.irc-announce { nick = config.networking.hostName; -- cgit v1.2.3 From 179502bb0a5d47f6dca68a8ee87a57e833332ece Mon Sep 17 00:00:00 2001 From: lassulus Date: Tue, 28 Jun 2016 17:30:54 +0200 Subject: l 2 repo-sync: add access for lass accs --- lass/2configs/repo-sync.nix | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'lass/2configs/repo-sync.nix') diff --git a/lass/2configs/repo-sync.nix b/lass/2configs/repo-sync.nix index afe2abb6..45a4e2af 100644 --- a/lass/2configs/repo-sync.nix +++ b/lass/2configs/repo-sync.nix @@ -22,7 +22,11 @@ let }; in { rules = with git; singleton { - user = [ config.krebs.users."${config.networking.hostName}-repo-sync" ]; + user = with config.krebs.users; [ + config.krebs.users."${config.networking.hostName}-repo-sync" + lass + lass-shodan + ]; repo = [ repo ]; perm = push ''refs/*'' [ non-fast-forward create delete merge ]; }; -- cgit v1.2.3