From aa04423e3a313271fca4d951d8717459e7969d60 Mon Sep 17 00:00:00 2001 From: tv Date: Thu, 6 Sep 2018 23:02:56 +0200 Subject: irc-announce: whitelist refs instead of branches --- lass/2configs/git.nix | 13 +++++++++---- lass/2configs/repo-sync.nix | 6 ++++-- 2 files changed, 13 insertions(+), 6 deletions(-) (limited to 'lass') diff --git a/lass/2configs/git.nix b/lass/2configs/git.nix index 829e62269..011c6022c 100644 --- a/lass/2configs/git.nix +++ b/lass/2configs/git.nix @@ -100,10 +100,12 @@ let # TODO make nick = config.krebs.build.host.name the default nick = config.krebs.build.host.name; channel = "#xxx"; + # TODO define refs in some kind of option per repo + refs = [ + "refs/heads/master" + ]; server = "irc.r"; verbose = config.krebs.build.host.name == "prism"; - # TODO define branches in some kind of option per repo - branches = [ "master" ]; }; }; }; @@ -121,10 +123,13 @@ let # TODO make nick = config.krebs.build.host.name the default nick = config.krebs.build.host.name; channel = "#xxx"; + # TODO define refs in some kind of option per repo + refs = [ + "refs/heads/master" + "refs/heads/staging*" + ]; server = "irc.r"; verbose = false; - # TODO define branches in some kind of option per repo - branches = [ "master" "staging*" ]; }; } // hooks; }; diff --git a/lass/2configs/repo-sync.nix b/lass/2configs/repo-sync.nix index 6a07172fe..8b7d0db71 100644 --- a/lass/2configs/repo-sync.nix +++ b/lass/2configs/repo-sync.nix @@ -14,10 +14,12 @@ let hooks = mkIf announce (mkDefault { post-receive = pkgs.git-hooks.irc-announce { nick = config.networking.hostName; - verbose = false; channel = "#xxx"; + refs = [ + "refs/heads/newest" + ]; server = "irc.r"; - branches = [ "newest" ]; + verbose = false; }; }); }; -- cgit v1.2.3 From b3bb832f49bb73620e60f337c99692f6354da16d Mon Sep 17 00:00:00 2001 From: lassulus Date: Sat, 8 Sep 2018 22:36:20 +0200 Subject: l reaktor-coders: add !flip --- lass/2configs/reaktor-coders.nix | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'lass') diff --git a/lass/2configs/reaktor-coders.nix b/lass/2configs/reaktor-coders.nix index 86877df7a..9365582b8 100644 --- a/lass/2configs/reaktor-coders.nix +++ b/lass/2configs/reaktor-coders.nix @@ -106,6 +106,12 @@ with import ; exec echo '¯\_(ツ)_/¯' ''; }) + (buildSimpleReaktorPlugin "flip" { + pattern = "^!flip$"; + script = pkgs.writeDash "shrug" '' + exec echo '(╯°□°)╯ ┻━┻' + ''; + }) ]; }; } -- cgit v1.2.3 From 9c78fb6039ef12c0582e4d562ef4e11b4f6e47ff Mon Sep 17 00:00:00 2001 From: lassulus Date: Sat, 8 Sep 2018 22:54:29 +0200 Subject: l mors: open quake3 ports --- lass/1systems/mors/config.nix | 3 +++ 1 file changed, 3 insertions(+) (limited to 'lass') diff --git a/lass/1systems/mors/config.nix b/lass/1systems/mors/config.nix index 90e04cad1..5a9c26b9d 100644 --- a/lass/1systems/mors/config.nix +++ b/lass/1systems/mors/config.nix @@ -40,6 +40,9 @@ with import ; { predicate = "-p tcp --dport 11100"; target = "ACCEPT"; } #chromecast { predicate = "-p udp -m multiport --sports 32768:61000 -m multiport --dports 32768:61000"; target = "ACCEPT"; } + #quake3 + { predicate = "-p tcp --dport 27950:27965"; target = "ACCEPT"; } + { predicate = "-p udp --dport 27950:27965"; target = "ACCEPT"; } ]; } { -- cgit v1.2.3 From dc45b085b6a10a3097e1c4c6bc96c439c5af57cd Mon Sep 17 00:00:00 2001 From: lassulus Date: Sat, 8 Sep 2018 23:38:56 +0200 Subject: l git: add krebspage --- lass/2configs/git.nix | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'lass') diff --git a/lass/2configs/git.nix b/lass/2configs/git.nix index 829e62269..923de683e 100644 --- a/lass/2configs/git.nix +++ b/lass/2configs/git.nix @@ -38,6 +38,10 @@ let cgit.desc = "take a description of your disk layout and produce a format script"; cgit.section = "software"; }; + krebspage = { + cgit.desc = "homepage of krebs"; + cgit.section = "configuration"; + }; news = { cgit.desc = "take a rss feed and a timeout and print it to stdout"; cgit.section = "software"; -- cgit v1.2.3 From df809dca51b2a4037449d626e14a75aa91be7b3a Mon Sep 17 00:00:00 2001 From: tv Date: Sun, 9 Sep 2018 10:23:20 +0200 Subject: buildbot-stockholm: build using the test attribute While at it, fix */krops.nix to actually use the target attribute. --- lass/krops.nix | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) (limited to 'lass') diff --git a/lass/krops.nix b/lass/krops.nix index c5a932206..4e045c6db 100644 --- a/lass/krops.nix +++ b/lass/krops.nix @@ -27,14 +27,9 @@ in { target = "root@${name}/var/src"; }; - # usage: $(nix-build --no-out-link --argstr name HOSTNAME -A test) - test = pkgs.krops.writeTest "${name}-test" { + # usage: $(nix-build --no-out-link --argstr name HOSTNAME --argstr target PATH -A test) + test = { target }: pkgs.krops.writeTest "${name}-test" { + inherit target; source = source { test = true; }; - target = "${lib.getEnv "HOME"}/tmp/${name}-stockholm-test"; - }; - - ci = pkgs.krops.writeTest "${name}-test" { - source = source { test = true; }; - target = "${lib.getEnv "HOME"}/stockholm-build"; }; } -- cgit v1.2.3 From 669dd0b1f9731ad6dec89cf8eb88eb87c9c5354d Mon Sep 17 00:00:00 2001 From: lassulus Date: Sun, 9 Sep 2018 10:53:10 +0200 Subject: l: RIP repo-sync --- lass/1systems/mors/config.nix | 1 - lass/1systems/prism/config.nix | 1 - lass/2configs/repo-sync.nix | 144 ----------------------------------------- 3 files changed, 146 deletions(-) delete mode 100644 lass/2configs/repo-sync.nix (limited to 'lass') diff --git a/lass/1systems/mors/config.nix b/lass/1systems/mors/config.nix index 5a9c26b9d..aa10ed46e 100644 --- a/lass/1systems/mors/config.nix +++ b/lass/1systems/mors/config.nix @@ -21,7 +21,6 @@ with import ; - diff --git a/lass/1systems/prism/config.nix b/lass/1systems/prism/config.nix index 0f20d1c4e..f83721070 100644 --- a/lass/1systems/prism/config.nix +++ b/lass/1systems/prism/config.nix @@ -133,7 +133,6 @@ with import ; - diff --git a/lass/2configs/repo-sync.nix b/lass/2configs/repo-sync.nix deleted file mode 100644 index 8b7d0db71..000000000 --- a/lass/2configs/repo-sync.nix +++ /dev/null @@ -1,144 +0,0 @@ -{ config, lib, pkgs, ... }: - -with import ; - -let - mirror = "git@${config.networking.hostName}:"; - - defineRepo = name: announce: let - repo = { - public = true; - name = mkDefault "${name}"; - cgit.desc = mkDefault "mirror for ${name}"; - cgit.section = mkDefault "mirror"; - hooks = mkIf announce (mkDefault { - post-receive = pkgs.git-hooks.irc-announce { - nick = config.networking.hostName; - channel = "#xxx"; - refs = [ - "refs/heads/newest" - ]; - server = "irc.r"; - verbose = false; - }; - }); - }; - in { - rules = with git; [ - { - user = with config.krebs.users; [ - config.krebs.users."${config.networking.hostName}-repo-sync" - lass - lass-mors - lass-shodan - ]; - repo = [ repo ]; - perm = push ''refs/*'' [ non-fast-forward create delete merge ]; - } - { - user = attrValues config.krebs.users; - repo = [ repo ]; - perm = fetch; - } - ]; - repos."${name}" = repo; - }; - - sync-retiolum = name: - { - krebs.repo-sync.repos.${name} = { - 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}"; - }; - 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}"; - }; - }; - latest = { - url = "${mirror}${name}"; - ref = "heads/newest"; - }; - }; - krebs.git = defineRepo name (config.networking.hostName == "prism"); - }; - - sync-remote = name: url: - { - krebs.repo-sync.repos.${name} = { - branches = { - remote = { - origin.url = url; - mirror.url = "${mirror}${name}"; - }; - }; - }; - krebs.git = defineRepo name (config.networking.hostName == "prism"); - }; - - sync-remote-silent = name: url: - { - krebs.repo-sync.repos.${name} = { - branches = { - remote = { - origin.url = url; - mirror.url = "${mirror}${name}"; - }; - }; - }; - krebs.git = defineRepo name false; - }; - -in { - krebs.repo-sync = { - enable = true; - unitConfig.ConditionPathExists = "!/var/run/ppp0.pid"; - }; - imports = [ - (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") - (sync-remote "realwallpaper" "https://github.com/lassulus/realwallpaper") - (sync-remote "lassulus-blog" "https://github.com/lassulus/lassulus-blog") - (sync-remote "painload" "https://github.com/krebs/painload") - (sync-remote "Reaktor" "https://github.com/krebs/Reaktor") - (sync-remote "nixos-wiki" "https://github.com/Mic92/nixos-wiki.wiki.git") - (sync-retiolum "go") - (sync-retiolum "much") - (sync-retiolum "newsbot-js") - (sync-retiolum "populate") - (sync-retiolum "stockholm") - (sync-retiolum "wai-middleware-time") - (sync-retiolum "xmonad-stockholm") - (sync-retiolum "nix-writers") - ]; -} -- cgit v1.2.3 From 2dccd7d8d30f7e5dc7eed4e9114f5c14fb255e69 Mon Sep 17 00:00:00 2001 From: lassulus Date: Sun, 9 Sep 2018 12:07:13 +0200 Subject: krebspage: init --- lass/2configs/websites/lassulus.nix | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'lass') diff --git a/lass/2configs/websites/lassulus.nix b/lass/2configs/websites/lassulus.nix index f60a66952..8f24fb212 100644 --- a/lass/2configs/websites/lassulus.nix +++ b/lass/2configs/websites/lassulus.nix @@ -82,6 +82,10 @@ in { c-base:$apr1$aQ6mYNR3$ho.aJ7icqSO.y.xKo3GQf0 ''}; ''; + locations."/krebspage".extraConfig = '' + default_type "text/html"; + alias ${pkgs.krebspage}/index.html; + ''; # TODO make this work! locations."= /ddate".extraConfig = let script = pkgs.writeBash "test" '' -- cgit v1.2.3 From 4016855f419802292387c10a794797fac3525f53 Mon Sep 17 00:00:00 2001 From: lassulus Date: Sun, 9 Sep 2018 12:07:33 +0200 Subject: l git: add buildbot-classic --- lass/2configs/git.nix | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'lass') diff --git a/lass/2configs/git.nix b/lass/2configs/git.nix index caa7c3065..f102a2b33 100644 --- a/lass/2configs/git.nix +++ b/lass/2configs/git.nix @@ -30,6 +30,10 @@ let rules = concatMap make-rules (attrValues repos); public-repos = mapAttrs make-public-repo { + buildbot-classic = { + cgit.desc = "fork of buildbot"; + cgit.section = "software"; + }; cholerab = { cgit.desc = "krebs thesauron & enterprise-patterns"; cgit.section = "documentation"; -- cgit v1.2.3 From 2762b34abd440c802eb76cefbd3d5a6c4c7a4e80 Mon Sep 17 00:00:00 2001 From: lassulus Date: Sun, 9 Sep 2018 12:10:44 +0200 Subject: l: add some mail addresses --- lass/2configs/exim-smarthost.nix | 2 ++ 1 file changed, 2 insertions(+) (limited to 'lass') diff --git a/lass/2configs/exim-smarthost.nix b/lass/2configs/exim-smarthost.nix index 191e25831..846000a3a 100644 --- a/lass/2configs/exim-smarthost.nix +++ b/lass/2configs/exim-smarthost.nix @@ -87,6 +87,8 @@ with import ; { from = "hackbeach@lassul.us"; to = lass.mail; } { from = "transferwise@lassul.us"; to = lass.mail; } { from = "cis@lassul.us"; to = lass.mail; } + { from = "afra@lassul.us"; to = lass.mail; } + { from = "ksp@lassul.us"; to = lass.mail; } ]; system-aliases = [ { from = "mailer-daemon"; to = "postmaster"; } -- cgit v1.2.3 From e5b5fffa32f942d4471b0c21be76ba4b70116af0 Mon Sep 17 00:00:00 2001 From: lassulus Date: Sun, 9 Sep 2018 12:12:58 +0200 Subject: l mail: change keybinding for show/mide of bars --- lass/2configs/mail.nix | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'lass') diff --git a/lass/2configs/mail.nix b/lass/2configs/mail.nix index 2bb51b50a..9246abfed 100644 --- a/lass/2configs/mail.nix +++ b/lass/2configs/mail.nix @@ -176,6 +176,11 @@ let # top index bar in email view set pager_index_lines=7 + # top_index_bar toggle + macro pager ,@1 " set pager_index_lines=0; macro pager ] ,@2 'Toggle indexbar" + macro pager ,@2 " set pager_index_lines=3; macro pager ] ,@3 'Toggle indexbar" + macro pager ,@3 " set pager_index_lines=7; macro pager ] ,@1 'Toggle indexbar" + macro pager ] ,@1 'Toggle indexbar # sidebar set sidebar_width = 20 @@ -186,9 +191,9 @@ let bind index sidebar-next # got to next folder in sidebar bind index sidebar-open # open selected folder from sidebar # sidebar toggle - macro index ,@) " set sidebar_visible=no; macro index ~ ,@( 'Toggle sidebar'" - macro index ,@( " set sidebar_visible=yes; macro index ~ ,@) 'Toggle sidebar'" - macro index ~ ,@( 'Toggle sidebar' # toggle the sidebar + macro index,pager ,@) " set sidebar_visible=no; macro index,pager [ ,@( 'Toggle sidebar'" + macro index,pager ,@( " set sidebar_visible=yes; macro index,pager [ ,@) 'Toggle sidebar'" + macro index,pager [ ,@( 'Toggle sidebar' # toggle the sidebar ''; mutt = pkgs.symlinkJoin { -- cgit v1.2.3 From ee0a456722241a5b52700f7be1ab0e30132c0133 Mon Sep 17 00:00:00 2001 From: lassulus Date: Sun, 9 Sep 2018 20:49:22 +0200 Subject: l mors.r: add bank to pkgs --- lass/1systems/mors/config.nix | 1 + 1 file changed, 1 insertion(+) (limited to 'lass') diff --git a/lass/1systems/mors/config.nix b/lass/1systems/mors/config.nix index aa10ed46e..69954a3e9 100644 --- a/lass/1systems/mors/config.nix +++ b/lass/1systems/mors/config.nix @@ -76,6 +76,7 @@ with import ; { environment.systemPackages = [ pkgs.ovh-zone + pkgs.bank ]; } { -- cgit v1.2.3 From a8d78528fcb039cd454f92047536ed81f756e774 Mon Sep 17 00:00:00 2001 From: lassulus Date: Sun, 9 Sep 2018 21:24:57 +0200 Subject: l git: add cgit-clear-cache as hook --- lass/2configs/git.nix | 58 ++++++++++++++++++++++++++++++--------------------- 1 file changed, 34 insertions(+), 24 deletions(-) (limited to 'lass') diff --git a/lass/2configs/git.nix b/lass/2configs/git.nix index f102a2b33..d5203deda 100644 --- a/lass/2configs/git.nix +++ b/lass/2configs/git.nix @@ -23,6 +23,10 @@ let ]; }; + cgit-clear-cache = pkgs.cgit-clear-cache.override { + inherit (config.krebs.git.cgit.settings) cache-root; + }; + repos = public-repos // optionalAttrs config.krebs.build.host.secure restricted-repos; @@ -104,17 +108,20 @@ let inherit cgit collaborators name; public = true; hooks = { - post-receive = pkgs.git-hooks.irc-announce { - # TODO make nick = config.krebs.build.host.name the default - nick = config.krebs.build.host.name; - channel = "#xxx"; - # TODO define refs in some kind of option per repo - refs = [ - "refs/heads/master" - ]; - server = "irc.r"; - verbose = config.krebs.build.host.name == "prism"; - }; + post-receive = '' + ${pkgs.git-hooks.irc-announce { + # TODO make nick = config.krebs.build.host.name the default + nick = config.krebs.build.host.name; + channel = "#xxx"; + # TODO define refs in some kind of option per repo + refs = [ + "refs/heads/master" + ]; + server = "irc.r"; + verbose = config.krebs.build.host.name == "prism"; + }} + ${cgit-clear-cache}/bin/cgit-clear-cache + ''; }; }; @@ -126,19 +133,22 @@ let make-restricted-repo = name: { admins ? [], collaborators ? [], announce ? false, hooks ? {}, ... }: { inherit admins collaborators name; public = false; - hooks = optionalAttrs announce { - post-receive = pkgs.git-hooks.irc-announce { - # TODO make nick = config.krebs.build.host.name the default - nick = config.krebs.build.host.name; - channel = "#xxx"; - # TODO define refs in some kind of option per repo - refs = [ - "refs/heads/master" - "refs/heads/staging*" - ]; - server = "irc.r"; - verbose = false; - }; + hooks = { + post-receive = '' + ${optionalString announce (pkgs.git-hooks.irc-announce { + # TODO make nick = config.krebs.build.host.name the default + nick = config.krebs.build.host.name; + channel = "#xxx"; + # TODO define refs in some kind of option per repo + refs = [ + "refs/heads/master" + "refs/heads/staging*" + ]; + server = "irc.r"; + verbose = false; + })} + ${cgit-clear-cache}/bin/cgit-clear-cache + ''; } // hooks; }; -- cgit v1.2.3 From f6e69c6ecb25fc96655ec1749747d9ccb7880365 Mon Sep 17 00:00:00 2001 From: lassulus Date: Sun, 9 Sep 2018 21:25:09 +0200 Subject: l git: add lass as admin --- lass/2configs/git.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lass') diff --git a/lass/2configs/git.nix b/lass/2configs/git.nix index d5203deda..300637ff8 100644 --- a/lass/2configs/git.nix +++ b/lass/2configs/git.nix @@ -156,7 +156,7 @@ let with git // config.krebs.users; repo: singleton { - user = [ lass-mors lass-shodan lass-icarus lass-blue ]; + user = [ lass lass-mors lass-shodan lass-icarus lass-blue ]; repo = [ repo ]; perm = push "refs/*" [ non-fast-forward create delete merge ]; } ++ -- cgit v1.2.3