summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--krebs/5pkgs/simple/brain/default.nix4
-rw-r--r--lass/2configs/buildbot-standalone.nix120
-rw-r--r--makefu/1systems/x.nix2
-rw-r--r--makefu/2configs/default.nix2
-rw-r--r--makefu/2configs/deployment/dirctator.nix30
-rw-r--r--makefu/2configs/git/brain-retiolum.nix57
6 files changed, 117 insertions, 98 deletions
diff --git a/krebs/5pkgs/simple/brain/default.nix b/krebs/5pkgs/simple/brain/default.nix
index 079db825f..e69b44f0f 100644
--- a/krebs/5pkgs/simple/brain/default.nix
+++ b/krebs/5pkgs/simple/brain/default.nix
@@ -1,11 +1,11 @@
{ pass, writeOut, writeDash, ... }:
writeOut "brain" {
- "/bin/brain-pass".link = writeDash "brain-pass" ''
+ "/bin/brain".link = writeDash "brain" ''
PASSWORD_STORE_DIR=$HOME/brain \
exec ${pass}/bin/pass $@
'';
- "/bin/brain-passmenu".link = writeDash "brain-passmenu" ''
+ "/bin/brainmenu".link = writeDash "brainmenu" ''
PASSWORD_STORE_DIR=$HOME/brain \
exec ${pass}/bin/passmenu $@
'';
diff --git a/lass/2configs/buildbot-standalone.nix b/lass/2configs/buildbot-standalone.nix
index 5edd1075d..e765ddbb4 100644
--- a/lass/2configs/buildbot-standalone.nix
+++ b/lass/2configs/buildbot-standalone.nix
@@ -32,7 +32,7 @@ in {
stockholm_repo,
workdir='stockholm-poller', branches=True,
project='stockholm',
- pollinterval=120
+ pollinterval=10
)
)
'';
@@ -44,7 +44,7 @@ in {
change_filter=util.ChangeFilter(branch_re=".*"),
treeStableTimer=10,
name="build-all-branches",
- builderNames=["build-hosts", "build-pkgs"]
+ builderNames=["build-hosts"]
)
)
'';
@@ -77,6 +77,11 @@ in {
"NIX_REMOTE": "daemon",
"dummy_secrets": "true",
}
+ env_tv = {
+ "LOGNAME": "tv",
+ "NIX_REMOTE": "daemon",
+ "dummy_secrets": "true",
+ }
# prepare nix-shell
# the dependencies which are used by the test script
@@ -91,6 +96,7 @@ in {
# SSL_CERT_FILE,LOGNAME,NIX_REMOTE
nixshell = [
"nix-shell",
+ "-I", "/var/src",
"-I", "stockholm=.",
"-p"
] + deps + [ "--run" ]
@@ -103,45 +109,31 @@ in {
build-hosts = ''
f = util.BuildFactory()
f.addStep(grab_repo)
- for i in [ "test-minimal-deploy", "test-all-krebs-modules", "wolf", "test-centos7" ]:
- addShell(f,name="build-{}".format(i),env=env_shared,
- command=nixshell + \
- ["mkdir -p $HOME/$LOGNAME && touch $HOME/$LOGNAME/.populate; \
- make NIX_PATH=$HOME/$LOGNAME test method=build \
- target=buildbotworker@${config.krebs.build.host.name}$HOME/$LOGNAME \
- system={}".format(i)
- ]
+
+ def build_host(env, host):
+ addShell(f,name="build-{}".format(i),env=env,
+ command=nixshell + ["mkdir -p $HOME/$LOGNAME && touch $HOME/$LOGNAME/.populate; \
+ echo $HOME; echo $LOGNAME; \
+ test -e $HOME/$LOGNAME/nixpkgs || cp -r /var/src/nixpkgs $HOME/$LOGNAME/; \
+ make NIX_PATH=$HOME/$LOGNAME:secrets=/var/src/stockholm/null test method=build \
+ target=buildbotworker@${config.krebs.build.host.name}$HOME/$LOGNAME \
+ system={}".format(host)]
)
+ for i in [ "alnus", "mu", "nomic", "wu", "xu", "zu" ]:
+ build_host(env_tv, i)
+
for i in [ "mors", "uriel", "shodan", "icarus", "cloudkrebs", "echelon", "dishfire", "prism" ]:
- addShell(f,name="build-{}".format(i),env=env_lass,
- command=nixshell + \
- ["mkdir -p $HOME/$LOGNAME && touch $HOME/$LOGNAME/.populate; \
- make NIX_PATH=$HOME/$LOGNAME test method=build \
- target=buildbotworker@${config.krebs.build.host.name}$HOME/$LOGNAME \
- system={}".format(i)
- ]
- )
+ build_host(env_lass, i)
for i in [ "x", "wry", "vbob", "wbob", "shoney" ]:
- addShell(f,name="build-{}".format(i),env=env_makefu,
- command=nixshell + \
- ["mkdir -p $HOME/$LOGNAME && touch $HOME/$LOGNAME/.populate; \
- make NIX_PATH=$HOME/$LOGNAME test method=build \
- target=buildbotworker@${config.krebs.build.host.name}$HOME/$LOGNAME \
- system={}".format(i)
- ]
- )
+ build_host(env_makefu, i)
for i in [ "hiawatha", "onondaga" ]:
- addShell(f,name="build-{}".format(i),env=env_nin,
- command=nixshell + \
- ["mkdir -p $HOME/$LOGNAME && touch $HOME/$LOGNAME/.populate; \
- make NIX_PATH=$HOME/$LOGNAME test method=build \
- target=buildbotworker@${config.krebs.build.host.name}$HOME/$LOGNAME \
- system={}".format(i)
- ]
- )
+ build_host(env_nin, i)
+
+ for i in [ "test-minimal-deploy", "test-all-krebs-modules", "wolf", "test-centos7" ]:
+ build_host(env_shared, i)
bu.append(
util.BuilderConfig(
@@ -152,63 +144,6 @@ in {
)
'';
-
- build-pkgs = ''
- f = util.BuildFactory()
- f.addStep(grab_repo)
- for i in [
- "apt-cacher-ng",
- "bepasty-client-cli",
- "cac-api",
- "cac-cert",
- "cac-panel",
- "charybdis",
- "collectd-connect-time",
- "dic",
- "drivedroid-gen-repo",
- "exim",
- "fortclientsslvpn",
- "get",
- "git-hooks",
- "github-hosts-sync",
- "go",
- "hashPassword",
- "haskellPackages.blessings",
- "haskellPackages.email-header",
- "haskellPackages.scanner",
- "haskellPackages.xmonad-stockholm",
- "krebspaste",
- "logf",
- "much",
- "newsbot-js",
- "noVNC",
- "ovh-zone",
- "passwdqc-utils",
- "populate",
- "posix-array",
- "pssh",
- "push",
- "Reaktor",
- "realwallpaper",
- "repo-sync",
- "retiolum-bootstrap",
- "tarantool",
- "test",
- "tinc_graphs",
- "translate-shell",
- "urlwatch",
- "with-tmpdir",
- "youtube-tools",
- ]:
- addShell(f,name="build-{}".format(i),env=env_lass,
- command=nixshell + \
- ["mkdir -p $HOME/$LOGNAME && touch $HOME/$LOGNAME/.populate; \
- make system=prism pkgs.{}".format(i)])
-
- bu.append(util.BuilderConfig(name="build-pkgs",
- workernames=workernames,
- factory=f))
- '';
};
enable = true;
web.enable = true;
@@ -230,9 +165,6 @@ in {
username = "testworker";
password = "lasspass";
packages = with pkgs; [ gnumake jq nix populate ];
- extraEnviron = {
- NIX_PATH="/var/src";
- };
};
config.krebs.iptables = {
tables = {
diff --git a/makefu/1systems/x.nix b/makefu/1systems/x.nix
index d1503c8d7..ee3a7bb1b 100644
--- a/makefu/1systems/x.nix
+++ b/makefu/1systems/x.nix
@@ -55,7 +55,7 @@ with import <stockholm/lib>;
../2configs/rad1o.nix
# services
- #../2configs/git/brain-retiolum.nix
+ ../2configs/git/brain-retiolum.nix
../2configs/tor.nix
../2configs/steam.nix
# ../2configs/buildbot-standalone.nix
diff --git a/makefu/2configs/default.nix b/makefu/2configs/default.nix
index 0d61e8dee..bcd998826 100644
--- a/makefu/2configs/default.nix
+++ b/makefu/2configs/default.nix
@@ -22,7 +22,7 @@ with import <stockholm/lib>;
user = config.krebs.users.makefu;
source = let
inherit (config.krebs.build) host user;
- ref = "a772c3a"; # unstable @ 2017-05-09 + graceful requests2
+ ref = "7a7c39c"; # unstable @ 2017-05-09 + graceful requests2 + logstash5
in {
nixpkgs = if config.makefu.full-populate || (getEnv "dummy_secrets" == "true") then
{
diff --git a/makefu/2configs/deployment/dirctator.nix b/makefu/2configs/deployment/dirctator.nix
new file mode 100644
index 000000000..b8e61955d
--- /dev/null
+++ b/makefu/2configs/deployment/dirctator.nix
@@ -0,0 +1,30 @@
+{ pkgs, lib, ... }:
+
+with lib;
+let
+ port = 18872;
+ runit = pkgs.writeDash "runit" ''
+ set -xeuf
+ export PULSE_COOKIE=/var/run/pulse/.config/pulse/cookie
+ echo "$@" | sed 's/^dirctator://' | ${pkgs.espeak}/bin/espeak -v mb-de7 2>&1 | tee -a /tmp/speak
+ '';
+in {
+ services.logstash = {
+ package = pkgs.logstash5;
+ enable = true;
+ inputConfig = ''
+ irc {
+ channels => [ "#krebs", "#afra" ]
+ host => "irc.freenode.net"
+ nick => "dirctator"
+ }
+ '';
+ filterConfig = ''
+ '';
+ outputConfig = ''
+ stdout { codec => rubydebug }
+ exec { command => "${runit} '%{message}" }
+ '';
+ plugins = [ ];
+ };
+}
diff --git a/makefu/2configs/git/brain-retiolum.nix b/makefu/2configs/git/brain-retiolum.nix
new file mode 100644
index 000000000..18275e3df
--- /dev/null
+++ b/makefu/2configs/git/brain-retiolum.nix
@@ -0,0 +1,57 @@
+{ config, lib, pkgs, ... }:
+# TODO: remove tv lib :)
+with import <stockholm/lib>;
+let
+
+ repos = krebs-repos;
+ rules = concatMap krebs-rules (attrValues krebs-repos);
+
+ krebs-repos = mapAttrs make-krebs-repo {
+ brain = { };
+ };
+
+
+ make-krebs-repo = with git; name: { cgit ? {}, ... }: {
+ inherit cgit name;
+ public = false;
+ hooks = {
+ post-receive = pkgs.git-hooks.irc-announce {
+ nick = config.networking.hostName;
+ verbose = true;
+ channel = "#retiolum";
+ # TODO remove the hardcoded hostname
+ server = "ni.r";
+ };
+ };
+ };
+
+
+
+ # TODO: get the list of all krebsministers
+ krebsminister = with config.krebs.users; [ lass tv ];
+ krebs-rules = repo:
+ set-owners repo [ config.krebs.users.makefu ] ++ set-ro-access repo krebsminister;
+
+ set-ro-access = with git; repo: user:
+ optional repo.public {
+ inherit user;
+ repo = [ repo ];
+ perm = fetch;
+ };
+
+ set-owners = with git;repo: user:
+ singleton {
+ inherit user;
+ repo = [ repo ];
+ perm = push "refs/*" [ non-fast-forward create delete merge ];
+ };
+
+in {
+ krebs.git = {
+ enable = true;
+ cgit = {
+ enable = false;
+ };
+ inherit repos rules;
+ };
+}