summaryrefslogtreecommitdiffstats
path: root/krebs/2configs/shack/radioactive.nix
diff options
context:
space:
mode:
authorlassulus <lassulus@lassul.us>2017-07-14 00:41:36 +0200
committerlassulus <lassulus@lassul.us>2017-07-14 00:41:36 +0200
commit8d128c769aec24d8989db8220d680ea6f4735193 (patch)
tree8c8a6132fda88ba989bbb7fc170b54b1ca242987 /krebs/2configs/shack/radioactive.nix
parentc4627764062a42f8d952ff90557c1e0d8735485f (diff)
parent58380c82848c3db0bd6c3d74904153f3464c2098 (diff)
Merge remote-tracking branch 'ni/master'
Diffstat (limited to 'krebs/2configs/shack/radioactive.nix')
-rw-r--r--krebs/2configs/shack/radioactive.nix35
1 files changed, 35 insertions, 0 deletions
diff --git a/krebs/2configs/shack/radioactive.nix b/krebs/2configs/shack/radioactive.nix
new file mode 100644
index 000000000..378b54056
--- /dev/null
+++ b/krebs/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;
+ };
+ };
+}