summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorlassulus <lass@lassul.us>2017-06-15 21:13:46 +0200
committerlassulus <lass@lassul.us>2017-06-15 21:13:46 +0200
commitc6605a3ab8f6a5098bbd3e011de50e37bf242a05 (patch)
tree57a0868c0dbe34aa553c5175c2f3ab29add0a330
parentfde07d4e5ed92309ca1c7570c936ec3d324ca2f3 (diff)
parent70260c70943cfcad80c268920566c1a858870b28 (diff)
Merge remote-tracking branch 'gum/master'
-rw-r--r--krebs/3modules/makefu/default.nix23
-rw-r--r--makefu/1systems/wry.nix4
-rw-r--r--makefu/2configs/deployment/led-fader.nix2
-rw-r--r--makefu/2configs/mail-client.nix3
-rw-r--r--makefu/5pkgs/studio-link/default.nix69
-rw-r--r--shared/1systems/wolf.nix8
-rw-r--r--shared/2configs/graphite.nix20
-rw-r--r--shared/2configs/shack/bincache.nix6
-rw-r--r--shared/2configs/shack/mqtt_sub.nix4
-rw-r--r--shared/2configs/shack/nix-cacher.nix3
-rw-r--r--shared/2configs/shack/radioactive.nix35
-rw-r--r--shared/2configs/shack/worlddomination.nix67
12 files changed, 233 insertions, 11 deletions
diff --git a/krebs/3modules/makefu/default.nix b/krebs/3modules/makefu/default.nix
index c95e1761c..7f8907c5b 100644
--- a/krebs/3modules/makefu/default.nix
+++ b/krebs/3modules/makefu/default.nix
@@ -782,6 +782,29 @@ with import <stockholm/lib>;
};
};
+ horisa = rec {
+ cores = 2;
+ nets = {
+ retiolum = {
+ ip4.addr = "10.243.226.213";
+ ip6.addr = "42:432e:2379:0cd2:8486:f3b5:335a:5d83";
+ aliases = [
+ "horisa.r"
+ ];
+ tinc.pubkey = ''
+ -----BEGIN RSA PUBLIC KEY-----
+ MIIBCgKCAQEA1hhBqCku98gimv0yXr6DFwE2HUemigyqX8o7IsPOW5XT/K8o+V40
+ Oxk3r0+c7IYREvug/raxoullf5TMJFzTzqzX4njgsiTs25V8D7hVT4jcRKTcXmBn
+ XpjtD+tIeDW1E6dIMMDbxKCyfd/qaeg83G7gPobeFYr4JNqQLXrnotlWMO9S13UT
+ +EgSP2pixv/dGIqX8WRg23YumO8jZKbso/sKKFMIEOJvnh/5EcWb24+q2sDRCitP
+ sWJ5j/9M1Naec/Zl27Ac2HyMWRk39F9Oo+iSbc47QvjKTEmn37P4bBg3hY9FSSFo
+ M90wG/NRbw1Voz6BgGlwOAoA+Ln0rVKqDQIDAQAB
+ -----END RSA PUBLIC KEY-----
+ '';
+ };
+ };
+ };
+
tahoe = rec {
cores = 1;
nets = {
diff --git a/makefu/1systems/wry.nix b/makefu/1systems/wry.nix
index 62ca171a9..f5097bf40 100644
--- a/makefu/1systems/wry.nix
+++ b/makefu/1systems/wry.nix
@@ -22,8 +22,8 @@ in {
# ../2configs/nginx/euer.test.nix
# collectd
- ../2configs/logging/central-stats-client.nix
- ../2configs/logging/central-logging-client.nix
+ ../2configs/stats/client.nix
+ ../2configs/logging/client.nix
../2configs/tinc/retiolum.nix
# ../2configs/torrent.nix
diff --git a/makefu/2configs/deployment/led-fader.nix b/makefu/2configs/deployment/led-fader.nix
index e4d62ae77..50023693d 100644
--- a/makefu/2configs/deployment/led-fader.nix
+++ b/makefu/2configs/deployment/led-fader.nix
@@ -29,7 +29,7 @@ in {
environment = {
NIX_PATH = "/var/src";
};
- after = [ (lib.optional config.services.mosqitto.enable "mosquitto.service") ];
+ # after = [ (lib.optional config.services.mosqitto.enable "mosquitto.service") ];
wantedBy = [ "multi-user.target" ];
serviceConfig = {
# User = "nobody"; # need a user with permissions to run nix-shell
diff --git a/makefu/2configs/mail-client.nix b/makefu/2configs/mail-client.nix
index 8319b89ce..e08aadc5e 100644
--- a/makefu/2configs/mail-client.nix
+++ b/makefu/2configs/mail-client.nix
@@ -7,10 +7,11 @@ with import <stockholm/lib>;
gnupg
imapfilter
msmtp
- mutt
notmuch
+ neomutt
offlineimap
openssl
w3m
];
+
}
diff --git a/makefu/5pkgs/studio-link/default.nix b/makefu/5pkgs/studio-link/default.nix
new file mode 100644
index 000000000..6fa40139b
--- /dev/null
+++ b/makefu/5pkgs/studio-link/default.nix
@@ -0,0 +1,69 @@
+{ stdenv, fetchurl, buildFHSUserEnv, writeTextFile, alsaLib, atk, cairo, cups
+, dbus, expat, fontconfig, freetype, gcc, gdk_pixbuf, glib, gnome2, gtk2, nspr
+, nss, pango, systemd, xorg, utillinuxMinimal, unzip, openssl, zlib, libjack2 }:
+
+let
+ libPath = stdenv.lib.makeLibraryPath [
+ alsaLib
+ atk
+ cairo
+ cups
+ dbus
+ expat
+ fontconfig
+ freetype
+ gcc.cc
+ gdk_pixbuf
+ glib
+ gnome2.GConf
+ gtk2
+ nspr
+ nss
+ pango
+
+ openssl
+ zlib
+ libjack2
+
+ systemd
+ xorg.libX11
+ xorg.libXScrnSaver
+ xorg.libXcomposite
+ xorg.libXcursor
+ xorg.libXdamage
+ xorg.libXext
+ xorg.libXfixes
+ xorg.libXi
+ xorg.libXrandr
+ xorg.libXrender
+ xorg.libXtst
+ ];
+in
+stdenv.mkDerivation rec {
+ name = "studio-link-${version}";
+ version = "17.03.1-beta";
+ src = fetchurl {
+ url = "https://github.com/Studio-Link-v2/backend/releases/download/v${version}/studio-link-standalone-linux.zip";
+ sha256 = "1y21nymin7iy64hcffc8g37fv305b1nvmh944hkf7ipb06kcx6r9";
+ };
+ buildInputs = [ unzip ];
+ phases = ["unpackPhase" "installPhase" "fixupPhase"];
+ unpackPhase = ''
+ unzip $src
+ '';
+ installPhase = ''
+ mkdir -p $out/bin
+ cp studio-link-standalone $out/bin/studio-link
+ chmod +x $out/bin/studio-link
+ '';
+ postFixup = ''
+ patchelf --set-interpreter $(cat $NIX_CC/nix-support/dynamic-linker) --set-rpath "${libPath}:\$ORIGIN" "$out/bin/studio-link"
+ '';
+
+ meta = with stdenv.lib; {
+ homepage = https://studio-link.com;
+ description = "Voip transfer";
+ platforms = platforms.linux;
+ maintainers = with maintainers; [ makefu ];
+ };
+}
diff --git a/shared/1systems/wolf.nix b/shared/1systems/wolf.nix
index 9acc5894b..f50fc80c4 100644
--- a/shared/1systems/wolf.nix
+++ b/shared/1systems/wolf.nix
@@ -7,7 +7,6 @@ in
../.
<nixpkgs/nixos/modules/profiles/qemu-guest.nix>
../2configs/collectd-base.nix
- ../2configs/shack/share.nix
../2configs/central-stats-client.nix
../2configs/save-diskspace.nix
@@ -15,11 +14,13 @@ in
../2configs/graphite.nix
../2configs/repo-sync.nix
../2configs/shared-buildbot.nix
- ../2configs/shack/drivedroid.nix
- ../2configs/shack/nix-cacher.nix
+ ../2configs/shack/drivedroid.nix
+ # ../2configs/shack/nix-cacher.nix
../2configs/shack/mqtt_sub.nix
../2configs/shack/muell_caller.nix
+ ../2configs/shack/radioactive.nix
+ ../2configs/shack/share.nix
];
# use your own binary cache, fallback use cache.nixos.org (which is used by
@@ -42,7 +43,6 @@ in
nix = {
binaryCaches = [
- "http://localhost:3142/nixos"
"http://cache.prism.r"
"https://cache.nixos.org/"
];
diff --git a/shared/2configs/graphite.nix b/shared/2configs/graphite.nix
index 689aedd04..64222e43a 100644
--- a/shared/2configs/graphite.nix
+++ b/shared/2configs/graphite.nix
@@ -10,7 +10,7 @@ with import <stockholm/lib>;
imports = [ ];
services.graphite = {
- web = {
+ api = {
enable = true;
listenAddress = "0.0.0.0";
};
@@ -23,7 +23,15 @@ with import <stockholm/lib>;
MAX_UPDATES_PER_SECOND = 1
MAX_CREATES_PER_MINUTE = 50
MAX_UPDATES_PER_SECOND_ONSHUTDOWN = 9001
+
+ LOG_CACHE_HITS = False
+ LOG_CACHE_QUEUE_SORTS = False
+ LOG_UPDATES = False
+ LOG_LISTENER_CONNECTIONS = False
+ LOG_CREATES = True
'';
+ storageAggregation = ''
+ '';
storageSchemas = ''
[carbon]
pattern = ^carbon\.
@@ -66,10 +74,20 @@ with import <stockholm/lib>;
pattern = ^elchos\.
retentions = 10s:14d,1m:90d,10m:5y
+ [icinga_default]
+ pattern = ^icinga
+ retentions = 10s:14d,5m:90d,10m:5y
+
+ [icinga_internals]
+ pattern = ^icinga.*\.(max_check_attempts|reachable|current_attempt|execution_time|latency|state|state_type)
+ retentions = 5m:7d
+
[default]
pattern = .*
retentions = 60s:30d,300s:1y
'';
};
};
+ systemd.services.carbonCache.serviceConfig.Restart="always";
+ systemd.services.graphiteApi.serviceConfig.Restart="always";
}
diff --git a/shared/2configs/shack/bincache.nix b/shared/2configs/shack/bincache.nix
new file mode 100644
index 000000000..9cd7fae23
--- /dev/null
+++ b/shared/2configs/shack/bincache.nix
@@ -0,0 +1,6 @@
+{...}:
+{
+ nix.binaryCaches = [
+ "http://wolf.shack:3142/nixos"
+ ];
+}
diff --git a/shared/2configs/shack/mqtt_sub.nix b/shared/2configs/shack/mqtt_sub.nix
index dafa06ba9..a8427dde4 100644
--- a/shared/2configs/shack/mqtt_sub.nix
+++ b/shared/2configs/shack/mqtt_sub.nix
@@ -6,8 +6,8 @@ let
name = "mqtt2graphite-2017-05-29";
src = pkgs.fetchgit {
url = "https://github.com/shackspace/mqtt2graphite/";
- rev = "8c060e6";
- sha256 = "06x7a1j6sfyvvdxg0366fcslhn478anqh4m5hljyf0z29knvz7pg";
+ rev = "117179d";
+ sha256 = "1334jbbzlqizyp7zcn4hdswhhrnkj1p4p435n5nph82lzffrsi44";
};
buildInputs = [
(pkgs.python35.withPackages (pythonPackages: with pythonPackages; [
diff --git a/shared/2configs/shack/nix-cacher.nix b/shared/2configs/shack/nix-cacher.nix
index 4fcbf3a4e..8feeca9af 100644
--- a/shared/2configs/shack/nix-cacher.nix
+++ b/shared/2configs/shack/nix-cacher.nix
@@ -4,6 +4,9 @@ let
cfg = config.krebs.apt-cacher-ng;
in
{
+ imports = [
+ ./bincache.nix
+ ];
krebs.apt-cacher-ng = {
enable = true;
port = 3142;
diff --git a/shared/2configs/shack/radioactive.nix b/shared/2configs/shack/radioactive.nix
new file mode 100644
index 000000000..378b54056
--- /dev/null
+++ b/shared/2configs/shack/radioactive.nix
@@ -0,0 +1,35 @@
+{ config, lib, pkgs, ... }:
+
+with import <stockholm/lib>;
+let
+ pkg = pkgs.stdenv.mkDerivation {
+ name = "radioactive-2017-06-01";
+ src = pkgs.fetchgit {
+ url = "https://github.com/makefu/nagios-radioactiveathome-plugins/";
+ rev = "955f614";
+ sha256 = "0ql6npl3n6shvij0ly6a52yjmf7dc31c5x29y927k9lvp8ygin20";
+ };
+ buildInputs = [
+ (pkgs.python3.withPackages (pythonPackages: with pythonPackages; [
+ docopt
+ requests2
+ python
+ ]))
+ ];
+ installPhase = ''
+ install -m755 -D add_many_points.py $out/bin/radioactive-add-many
+ '';
+ };
+in {
+ systemd.services.radioactive = {
+ description = "radioactive";
+ wantedBy = [ "multi-user.target" ];
+ serviceConfig = {
+ User = "nobody"; # TODO separate user
+ ExecStart = "${pkg}/bin/radioactive-add-many loop 60";
+ Restart = "always";
+ PrivateTmp = true;
+ PermissionsStartOnly = true;
+ };
+ };
+}
diff --git a/shared/2configs/shack/worlddomination.nix b/shared/2configs/shack/worlddomination.nix
new file mode 100644
index 000000000..ee461b51c
--- /dev/null
+++ b/shared/2configs/shack/worlddomination.nix
@@ -0,0 +1,67 @@
+{ config, lib, pkgs, ... }:
+
+with import <stockholm/lib>;
+let
+ pythonPackages = pkgs.python3Packages;
+ # https://github.com/chrysn/aiocoap
+ aiocoap = pythonPackages.buildPythonPackage {
+ name = "aiocoap-0.3";
+ src = pkgs.fetchurl { url = "https://pypi.python.org/packages/9c/f6/d839e4b14258d76e74a39810829c13f8dd31de2bfe0915579b2a609d1bbe/aiocoap-0.3.tar.gz"; sha256 = "402d4151db6d8d0b1d66af5b6e10e0de1521decbf12140637e5b8d2aa9c5aef6"; };
+ propagatedBuildInputs = [ ];
+ doCheck = false; # 2 errors, dunnolol
+ meta = with pkgs.stdenv.lib; {
+ homepage = "";
+ license = licenses.mit;
+ description = "Python CoAP library";
+ };
+ };
+ LinkHeader = pythonPackages.buildPythonPackage {
+ name = "LinkHeader-0.4.3";
+ src = pkgs.fetchurl { url = "https://pypi.python.org/packages/27/d4/eb1da743b2dc825e936ef1d9e04356b5701e3a9ea022c7aaffdf4f6b0594/LinkHeader-0.4.3.tar.gz"; sha256 = "7fbbc35c0ba3fbbc530571db7e1c886e7db3d718b29b345848ac9686f21b50c3"; };
+ propagatedBuildInputs = [ ];
+ meta = with pkgs.stdenv.lib; {
+ homepage = "";
+ license = licenses.bsdOriginal;
+ description = "Parse and format link headers according to RFC 5988 \"Web Linking\"";
+ };
+ };
+ pkg = pkgs.stdenv.mkDerivation {
+ name = "worlddomination-2017-06-08";
+ src = pkgs.fetchgit {
+ url = "https://github.com/shackspace/worlddomination/";
+ rev = "39344a4";
+ sha256 = "07alvdgz1vyww6nlay4qx4l7hnfqw0sqcdd9syhsjhqv3ciigwcp";
+ };
+ buildInputs = [
+ (pkgs.python3.withPackages (pythonPackages: with pythonPackages; [
+ docopt
+ LinkHeader
+ aiocoap
+ requests2
+ paramiko
+ python
+ ]))
+ ];
+ installPhase = ''
+ install -m755 -D backend/push_led.py $out/bin/push-led
+ install -m755 -D backend/loop_single.py $out/bin/loop-single
+ # copy the provided file to the package
+ install -m755 -D backend/wd.lst $out/${wdpath}
+ '';
+ };
+ wdpath = "/usr/worlddomination/wd.lst";
+ esphost = "10.42.24.7"; # esp8266
+ timeout = 10; # minutes
+in {
+ systemd.services.worlddomination = {
+ description = "run worlddomination";
+ wantedBy = [ "multi-user.target" ];
+ serviceConfig = {
+ User = "nobody"; # TODO separate user
+ ExecStart = "${pkg}/bin/push-led ${esphost} ${pkg}/${wdpath} loop ${toString timeout}";
+ Restart = "always";
+ PrivateTmp = true;
+ PermissionsStartOnly = true;
+ };
+ };
+}