summaryrefslogtreecommitdiffstats
path: root/makefu
diff options
context:
space:
mode:
Diffstat (limited to 'makefu')
-rw-r--r--makefu/1systems/wbob/config.nix51
-rw-r--r--makefu/2configs/stats/telegraf/airsensor.nix15
-rw-r--r--makefu/2configs/stats/telegraf/default.nix3
-rw-r--r--makefu/5pkgs/PkgDecrypt/default.nix27
-rw-r--r--makefu/5pkgs/airsensor-py/default.nix17
-rw-r--r--makefu/5pkgs/pkg2zip/default.nix29
6 files changed, 136 insertions, 6 deletions
diff --git a/makefu/1systems/wbob/config.nix b/makefu/1systems/wbob/config.nix
index ac51fd9ca..f7b60fa93 100644
--- a/makefu/1systems/wbob/config.nix
+++ b/makefu/1systems/wbob/config.nix
@@ -3,6 +3,7 @@ let
rootdisk = "/dev/disk/by-id/ata-TS256GMTS800_C613840115";
datadisk = "/dev/disk/by-id/ata-HGST_HTS721010A9E630_JR10006PH3A02F";
user = config.makefu.gui.user;
+ primaryIP = "192.168.8.11";
in {
imports =
@@ -10,16 +11,19 @@ in {
<stockholm/makefu>
<stockholm/makefu/2configs/zsh-user.nix>
<stockholm/makefu/2configs/tools/core.nix>
- <stockholm/makefu/2configs/tools/core-gui.nix>
- <stockholm/makefu/2configs/tools/extra-gui.nix>
- <stockholm/makefu/2configs/tools/media.nix>
+ <stockholm/makefu/2configs/disable_v6.nix>
+ # <stockholm/makefu/2configs/tools/core-gui.nix>
+ # <stockholm/makefu/2configs/tools/extra-gui.nix>
+ # <stockholm/makefu/2configs/tools/media.nix>
<stockholm/makefu/2configs/virtualisation/libvirt.nix>
<stockholm/makefu/2configs/tinc/retiolum.nix>
<stockholm/makefu/2configs/mqtt.nix>
<stockholm/makefu/2configs/deployment/led-fader.nix>
# <stockholm/makefu/2configs/gui/wbob-kiosk.nix>
+
<stockholm/makefu/2configs/stats/client.nix>
+
# <stockholm/makefu/2configs/gui/studio-virtual.nix>
# <stockholm/makefu/2configs/audio/jack-on-pulse.nix>
# <stockholm/makefu/2configs/audio/realtime-audio.nix>
@@ -27,6 +31,44 @@ in {
# Services
<stockholm/makefu/2configs/remote-build/slave.nix>
+ <stockholm/makefu/2configs/share/wbob.nix>
+
+ <stockholm/makefu/2configs/stats/telegraf>
+ <stockholm/makefu/2configs/stats/telegraf/airsensor.nix>
+ (let
+ collectd-port = 25826;
+ influx-port = 8086;
+ grafana-port = 3000; # TODO nginx forward
+ db = "collectd_db";
+ logging-interface = "enp0s25";
+ in {
+ services.grafana.enable = true;
+ services.grafana.addr = "0.0.0.0";
+
+ services.influxdb.enable = true;
+ services.influxdb.extraConfig = {
+ meta.hostname = config.krebs.build.host.name;
+ # meta.logging-enabled = true;
+ http.bind-address = ":${toString influx-port}";
+ admin.bind-address = ":8083";
+ collectd = [{
+ enabled = true;
+ typesdb = "${pkgs.collectd}/share/collectd/types.db";
+ database = db;
+ bind-address = ":${toString collectd-port}";
+ }];
+ };
+
+ networking.firewall.extraCommands = ''
+ iptables -A INPUT -i ${logging-interface} -p udp --dport ${toString collectd-port} -j ACCEPT
+ iptables -A INPUT -i ${logging-interface} -p tcp --dport ${toString influx-port} -j ACCEPT
+ iptables -A INPUT -i ${logging-interface} -p tcp --dport ${toString grafana-port} -j ACCEPT
+
+ ip6tables -A INPUT -i ${logging-interface} -p udp --dport ${toString collectd-port} -j ACCEPT
+ ip6tables -A INPUT -i ${logging-interface} -p tcp --dport ${toString influx-port} -j ACCEPT
+ ip6tables -A INPUT -i ${logging-interface} -p tcp --dport ${toString grafana-port} -j ACCEPT
+ '';
+ })
# temporary
# <stockholm/makefu/2configs/temp/rst-issue.nix>
@@ -96,6 +138,9 @@ in {
# rt2870 with nonfree creates wlp2s0 from wlp0s20u2
# not explicitly setting the interface results in wpa_supplicant to crash
networking.wireless.interfaces = [ "wlp2s0" ];
+ networking.interfaces.enp0s25.ip4 = [
+ { address = primaryIP; prefixLength = 24;}
+ ];
networking.interfaces.virbr1.ip4 = [{
address = "10.8.8.11";
prefixLength = 24;
diff --git a/makefu/2configs/stats/telegraf/airsensor.nix b/makefu/2configs/stats/telegraf/airsensor.nix
new file mode 100644
index 000000000..c0c64b238
--- /dev/null
+++ b/makefu/2configs/stats/telegraf/airsensor.nix
@@ -0,0 +1,15 @@
+{ pkgs, ...}:
+
+{
+ services.telegraf.extraConfig.inputs.exec = [
+ {
+ commands = [ "${pkgs.airsensor-py}/bin/airsensor-py"];
+ timeout = "10s";
+ data_format = "value";
+ data_type = "integer";
+ name_override = "airquality";
+ interval = "10s";
+ tags.unit="VOC";
+ }
+ ];
+}
diff --git a/makefu/2configs/stats/telegraf/default.nix b/makefu/2configs/stats/telegraf/default.nix
index 4da6561d6..049a9c037 100644
--- a/makefu/2configs/stats/telegraf/default.nix
+++ b/makefu/2configs/stats/telegraf/default.nix
@@ -2,9 +2,6 @@
let
url = "http://localhost:8086";
in {
- imports = [
- ./europastats.nix
- ];
services.telegraf = {
enable = true;
extraConfig = {
diff --git a/makefu/5pkgs/PkgDecrypt/default.nix b/makefu/5pkgs/PkgDecrypt/default.nix
new file mode 100644
index 000000000..80bcbcac1
--- /dev/null
+++ b/makefu/5pkgs/PkgDecrypt/default.nix
@@ -0,0 +1,27 @@
+{ stdenv, lib, pkgs, fetchFromGitHub, ... }:
+stdenv.mkDerivation rec {
+ name = "PkgDecrypt-2017-12-01";
+ rev = "e2f9518";
+
+ src = fetchFromGitHub {
+ owner = "St4rk";
+ repo = "PkgDecrypt";
+ inherit rev;
+ sha256 = "0dk13qamxyny0vc990s06vqddxwwc6xmikb1pkc3rnys98yda29p";
+ };
+
+ installPhase = ''
+ install -m755 -D pkg_dec $out/bin/pkg_dec
+ install -m755 -D make_key $out/bin/make_key
+ '';
+
+ buildInputs = with pkgs;[
+ zlib
+ ];
+
+ meta = {
+ homepage = https://github.com/St4rk/PkgDecrypt;
+ description = "St4rk's Vita pkg decrypter";
+ license = lib.licenses.gpl2;
+ };
+}
diff --git a/makefu/5pkgs/airsensor-py/default.nix b/makefu/5pkgs/airsensor-py/default.nix
new file mode 100644
index 000000000..b467872b4
--- /dev/null
+++ b/makefu/5pkgs/airsensor-py/default.nix
@@ -0,0 +1,17 @@
+{ pkgs, fetchFromGitHub, ... }:
+with pkgs.python3Packages;
+buildPythonApplication rec {
+ name = "airsensor-py-${version}";
+ version = "2017-04-24";
+ propagatedBuildInputs = [
+ pyusb
+ click
+ ];
+
+ src = fetchFromGitHub {
+ owner = "dfederschmidt";
+ repo = "airsensor-py";
+ rev = "c476918";
+ sha256 = "0dc88vqxsgx20asbwfdjmz6yl6bvv65k0krvmmss3gcwxdgh9p2q";
+ };
+}
diff --git a/makefu/5pkgs/pkg2zip/default.nix b/makefu/5pkgs/pkg2zip/default.nix
new file mode 100644
index 000000000..36c3d7176
--- /dev/null
+++ b/makefu/5pkgs/pkg2zip/default.nix
@@ -0,0 +1,29 @@
+{ stdenv, lib, pkgs, fetchFromGitHub, ... }:
+stdenv.mkDerivation rec {
+ name = "pkg2zip-2017-12-01";
+ rev = "fccad26";
+
+ src = fetchFromGitHub {
+ owner = "mmozeiko";
+ repo = "pkg2zip";
+ inherit rev;
+ sha256 = "1sq9yx5cbllmc0yyxhvb6c0yq1mkd1mn8njgkkgxz8alw9zwlarp";
+ };
+
+ installPhase = ''
+ install -m755 -D pkg2zip $out/bin/pkg2zip
+
+ install -m755 -D rif2zrif.py $out/bin/rif2zrif
+ install -m755 -D zrif2rif.py $out/bin/zrif2rif
+ '';
+
+ buildInputs = with pkgs;[
+ python3
+ ];
+
+ meta = {
+ homepage = https://github.com/St4rk/PkgDecrypt;
+ description = "St4rk's Vita pkg decrypter";
+ license = lib.licenses.gpl2;
+ };
+}