From d29217c88bec4023736c77877fd778a13e78b3b3 Mon Sep 17 00:00:00 2001 From: makefu Date: Tue, 6 Jun 2017 14:03:07 +0200 Subject: s nix-cacher: split to shack bincache/acng --- shared/2configs/shack/bincache.nix | 6 ++++++ shared/2configs/shack/nix-cacher.nix | 3 +++ 2 files changed, 9 insertions(+) create mode 100644 shared/2configs/shack/bincache.nix (limited to 'shared/2configs/shack') 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/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; -- cgit v1.2.3 From 777adbb420c8b046b0c222d7f0b8480c32f9a8c0 Mon Sep 17 00:00:00 2001 From: makefu Date: Tue, 6 Jun 2017 14:03:24 +0200 Subject: s 1 wolf: enable radioactive --- shared/2configs/shack/radioactive.nix | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 shared/2configs/shack/radioactive.nix (limited to 'shared/2configs/shack') 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 ; +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; + }; + }; +} -- cgit v1.2.3 From b166fb32c080720fe18b145e27ae69b9d0e3ea90 Mon Sep 17 00:00:00 2001 From: makefu Date: Tue, 6 Jun 2017 18:52:10 +0200 Subject: s 2: add worlddomination --- shared/2configs/shack/worlddomination.nix | 67 +++++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 shared/2configs/shack/worlddomination.nix (limited to 'shared/2configs/shack') diff --git a/shared/2configs/shack/worlddomination.nix b/shared/2configs/shack/worlddomination.nix new file mode 100644 index 000000000..634cd7d2e --- /dev/null +++ b/shared/2configs/shack/worlddomination.nix @@ -0,0 +1,67 @@ +{ config, lib, pkgs, ... }: + +with import ; +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-01"; + src = pkgs.fetchgit { + url = "https://github.com/shackspace/worlddomination/"; + rev = "e6a2df4"; + sha256 = "1zwv18v47lzj8yslip876n46f50822ycx0d6zbhp72h8hw0ar46f"; + }; + 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; + }; + }; +} -- cgit v1.2.3 From f0c7ef456ffbf8081082a21f67a57ba4ff1d7958 Mon Sep 17 00:00:00 2001 From: makefu Date: Fri, 9 Jun 2017 13:53:48 +0200 Subject: s 2 mqtt_sub: bump version --- shared/2configs/shack/mqtt_sub.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'shared/2configs/shack') 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; [ -- cgit v1.2.3 From ec65fabcb43c813f1977496eab47e5aaa44ff5cf Mon Sep 17 00:00:00 2001 From: makefu Date: Fri, 9 Jun 2017 13:54:05 +0200 Subject: s 2 worlddomination: bump version --- shared/2configs/shack/worlddomination.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'shared/2configs/shack') diff --git a/shared/2configs/shack/worlddomination.nix b/shared/2configs/shack/worlddomination.nix index 634cd7d2e..ee461b51c 100644 --- a/shared/2configs/shack/worlddomination.nix +++ b/shared/2configs/shack/worlddomination.nix @@ -26,11 +26,11 @@ let }; }; pkg = pkgs.stdenv.mkDerivation { - name = "worlddomination-2017-06-01"; + name = "worlddomination-2017-06-08"; src = pkgs.fetchgit { url = "https://github.com/shackspace/worlddomination/"; - rev = "e6a2df4"; - sha256 = "1zwv18v47lzj8yslip876n46f50822ycx0d6zbhp72h8hw0ar46f"; + rev = "39344a4"; + sha256 = "07alvdgz1vyww6nlay4qx4l7hnfqw0sqcdd9syhsjhqv3ciigwcp"; }; buildInputs = [ (pkgs.python3.withPackages (pythonPackages: with pythonPackages; [ -- cgit v1.2.3 From 2cb779a54972197e69aeb53f14a6b3e391844d34 Mon Sep 17 00:00:00 2001 From: makefu Date: Sun, 18 Jun 2017 14:09:02 +0200 Subject: s 1 wolf: bump worlddomination --- shared/2configs/shack/worlddomination.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'shared/2configs/shack') diff --git a/shared/2configs/shack/worlddomination.nix b/shared/2configs/shack/worlddomination.nix index ee461b51c..d0f9f5fa6 100644 --- a/shared/2configs/shack/worlddomination.nix +++ b/shared/2configs/shack/worlddomination.nix @@ -26,11 +26,11 @@ let }; }; pkg = pkgs.stdenv.mkDerivation { - name = "worlddomination-2017-06-08"; + name = "worlddomination-2017-06-10"; src = pkgs.fetchgit { url = "https://github.com/shackspace/worlddomination/"; - rev = "39344a4"; - sha256 = "07alvdgz1vyww6nlay4qx4l7hnfqw0sqcdd9syhsjhqv3ciigwcp"; + rev = "72fc9b5"; + sha256 = "05h500rswzypcxy4i22qc1vkc8izbzfqa9m86xg289hjxh133xyf"; }; buildInputs = [ (pkgs.python3.withPackages (pythonPackages: with pythonPackages; [ -- cgit v1.2.3