summaryrefslogtreecommitdiffstats
path: root/shared/2configs/shack/radioactive.nix
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2017-06-18 16:12:54 +0200
committertv <tv@krebsco.de>2017-06-18 16:12:54 +0200
commit8cb9d8ac4f99ed0a930b1657c4ef2ea769c5a86c (patch)
tree4459cf7a7c5d897830fde0edfa0e41297a223980 /shared/2configs/shack/radioactive.nix
parent11a16797df89862be7dff81b6af5cd5bf41b580c (diff)
parentef2f6afaa331113eb45d43845cb42d54a1430982 (diff)
Merge remote-tracking branch 'prism/master'
Diffstat (limited to 'shared/2configs/shack/radioactive.nix')
-rw-r--r--shared/2configs/shack/radioactive.nix35
1 files changed, 35 insertions, 0 deletions
diff --git a/shared/2configs/shack/radioactive.nix b/shared/2configs/shack/radioactive.nix
new file mode 100644
index 0000000..378b540
--- /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;
+ };
+ };
+}